Changes between Version 6 and Version 7 of Migration_of_MSPlugins


Ignore:
Timestamp:
11/10/2016 10:01:52 PM (4 years ago)
Author:
sena
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Migration_of_MSPlugins

    v6 v7  
    2424* '''org.grits.toolbox.entry.ms.annotation.glycan''' - see [wiki:Entry_MS_Annotation_Glycan_Migration this] page for general migration changes for this plugin
    2525* '''org.grits.toolbox.entry.ms.annotation.glycan.report''' - see [wiki:Entry_MS_Annotation_Glycan_Report_Migration this] page for general migration changes for this plugin
     26
     27== Preference Handling ==
     28
     29There 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.
     30
     31=== Table Header/Cartoon option related preferences ===
     32Whenever these preferences change, any open viewer needs to reflect the changes in their tables.
     33
     34- MassSpecViewerPreference
     35- MSAnnotationViewerPreference
     36- MSGlycanAnnotationViewerPreference
     37- MSGlycanAnnotationSummaryViewerPreference
     38- MSGlycanAnnotationCartoonPreferences
     39- MSGlycanAnnotationReportViewerPreference
     40
     41In order to reflect preference changes, the parts (multi-page editors or specific pages (tabs) within the editor)
     42needs to subscribe to the changes on the specific preference that they are interested in.
     43
     44An example subscription code is shown below:
     45
     46{{{
     47        @Optional @Inject
     48        public void updatePreferences(@UIEventTopic(IGritsPreferenceStore.EVENT_TOPIC_PREF_VALUE_CHANGED)
     49                                                String preferenceName)
     50        {
     51                if(MassSpecViewerPreference.getPreferenceID().equals(preferenceName)) {
     52                        PreferenceEntity preferenceEntity;
     53                        try {
     54                                preferenceEntity = gritsPreferenceStore.getPreferenceEntity(preferenceName);
     55                       
     56                                MassSpecViewerPreference updatePref = (MassSpecViewerPreference) TableViewerPreference.getTableViewerPreference(preferenceEntity, MassSpecViewerPreference.class);
     57                                this.updateColumnVisibility(updatePref);
     58                        } catch (UnsupportedVersionException e) {
     59                                logger.error("Error updating column visibility", e);
     60                        }
     61                }
     62        }
     63}}}
     64
     65The above code is from MassSpecMultiPageViewer class. This multi-page editor needs to update its table's column visibility whenever MassSpecViewerPreference gets updated.