Changes between Version 12 and Version 13 of Migration_of_MSPlugins


Ignore:
Timestamp:
11/11/2016 04:55:43 PM (4 years ago)
Author:
sena
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Migration_of_MSPlugins

    v12 v13  
    6464}}}
    6565
    66 The above code is from MassSpecMultiPageViewer class (entry.ms plugin). This multi-page editor needs to update its table's column visibility whenever MassSpecViewerPreference gets updated.
    67 
    68 Similarly, MSAnnotationMultiPageViewer (entry.ms.annotation plugin) needs to listen to the changes in MSAnnotationViewerPreference as shown below:
     66The above code is from '''MassSpecMultiPageViewer''' class (entry.ms plugin). This multi-page editor needs to update its table's column visibility whenever MassSpecViewerPreference gets updated.
     67
     68Similarly, '''MSAnnotationMultiPageViewer''' (entry.ms.annotation plugin) needs to listen to the changes in MSAnnotationViewerPreference as shown below:
    6969
    7070{{{
     
    8989
    9090
    91 MSGlycanAnnotationMultiPageViewer (entry.ms.annotation.glycan) needs to listen to the changes for two types (MSGlycanAnnotationViewerPreference and MSGlycanAnnotationSummaryViewerPreference) of preferences.
     91'''MSGlycanAnnotationMultiPageViewer''' (entry.ms.annotation.glycan) needs to listen to the changes for two types (MSGlycanAnnotationViewerPreference and MSGlycanAnnotationSummaryViewerPreference) of preferences.
    9292
    9393{{{
     
    182182
    183183
    184 
     184Finally, '''MSGlycanAnnotationReportMultiPageViewer''' listens to the changes to MSGlycanAnnotationReportViewerPreference.
     185
     186{{{
     187public class MSGlycanAnnotationReportMultiPageViewer extends CancelableMultiPageEditor {
     188       
     189        ...
     190
     191        @Optional @Inject
     192        public void updatePreferences(@UIEventTopic(IGritsPreferenceStore.EVENT_TOPIC_PREF_VALUE_CHANGED)
     193                                                String preferenceName)
     194        {
     195                if(preferenceName != null && preferenceName.startsWith(MSGlycanAnnotationReportViewerPreference.class.getName())) {
     196                        PreferenceEntity preferenceEntity;
     197                        try {
     198                                preferenceEntity = gritsPreferenceStore.getPreferenceEntity(preferenceName);
     199                       
     200                                MSGlycanAnnotationReportViewerPreference updatePref = (MSGlycanAnnotationReportViewerPreference)
     201                                         TableViewerPreference.getTableViewerPreference(preferenceEntity, MSGlycanAnnotationReportViewerPreference.class);
     202                                this.updateColumnVisibility(updatePref);
     203                        } catch (UnsupportedVersionException e) {
     204                                logger.error("Error updating column visibility", e);
     205                        }
     206                }
     207        }
     208
     209        ...
     210}
     211