wiki:Migration_of_MSPlugins

Version 7 (modified by sena, 4 years ago) (diff)

--

List of MS plugins migrated

  • org.grits.toolbox.display.control.table - removed reference to PartInitException and changed the Activator (do not extend AbstractUIPlugin)
  • org.grits.toolbox.display.control.spectrum - changed the Activator (do not extend AbstractUIPlugin)
  • org.grits.toolbox.datamodel.ms - no changes
  • org.grits.toolbox.datamodel.ms.annotation - no changes
  • org.grits.toolbox.datamodel.ms.annotation.glycan - no changes
  • org.grits.toolbox.datamodel.ms.annotation.glycan.report - no changes
  • org.grits.toolbox.importer.ms - migrated commands/handlers to E4 (moved from plugin.xml -> fragment.4xmi)
    • an essential step: before you open the part for the newly created entry, the selection needs to be set to the newly created entry
          // post may not work because of synchronization 
          // the selection needs to change before we try to open the part!
          eventBroker.send(IGritsDataModelService.EVENT_SELECT_ENTRY, newMSEntry);
          gritsUIService.openEntryInPart(newMSEntry);
      
  • org.grits.toolbox.importer.ms.annotation.glycan.simiansearch - migrated commands/handlers to E4 (moved from plugin.xml -> fragment.4xmi)
  • org.grits.toolbox.io.ms.annotation - changed the Activator (do not extend AbstractUIPlugin)
  • org.grits.toolbox.io.ms.annotation.glycan - no changes
  • org.grits.toolbox.io.ms.annotation.glycan.report - no changes
  • org.grits.toolbox.widgets - moved editor package to core plugin and migrated the editor implementation to E4
  • org.grits.toolbox.entry.ms - see this page for general migration changes for this plugin
  • org.grits.toolbox.entry.ms.annotation - see this page for general migration changes for this plugin
  • org.grits.toolbox.entry.ms.annotation.glycan - see this page for general migration changes for this plugin
  • org.grits.toolbox.entry.ms.annotation.glycan.report - see this? page for general migration changes for this plugin

Preference Handling

There are several preferences used in MS plugins. One important distinction is that some require changes to be propagated to the active viewers/table and the others are only retrieved when creating new experiment entries.

Table Header/Cartoon option related preferences

Whenever these preferences change, any open viewer needs to reflect the changes in their tables.

  • MassSpecViewerPreference
  • MSAnnotationViewerPreference
  • MSGlycanAnnotationViewerPreference
  • MSGlycanAnnotationSummaryViewerPreference
  • MSGlycanAnnotationCartoonPreferences
  • MSGlycanAnnotationReportViewerPreference

In order to reflect preference changes, the parts (multi-page editors or specific pages (tabs) within the editor) needs to subscribe to the changes on the specific preference that they are interested in.

An example subscription code is shown below:

        @Optional @Inject
	public void updatePreferences(@UIEventTopic(IGritsPreferenceStore.EVENT_TOPIC_PREF_VALUE_CHANGED)
	 					String preferenceName)
	{
		if(MassSpecViewerPreference.getPreferenceID().equals(preferenceName)) {
	 		PreferenceEntity preferenceEntity;
			try {
				preferenceEntity = gritsPreferenceStore.getPreferenceEntity(preferenceName);
			
				MassSpecViewerPreference updatePref = (MassSpecViewerPreference) TableViewerPreference.getTableViewerPreference(preferenceEntity, MassSpecViewerPreference.class);
				this.updateColumnVisibility(updatePref);
			} catch (UnsupportedVersionException e) {
				logger.error("Error updating column visibility", e);
			}
		}
	}

The above code is from MassSpecMultiPageViewer class. This multi-page editor needs to update its table's column visibility whenever MassSpecViewerPreference gets updated.