Changes between Version 7 and Version 8 of Entry_MS_Migration


Ignore:
Timestamp:
11/11/2016 05:34:11 PM (4 years ago)
Author:
sena
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Entry_MS_Migration

    v7 v8  
    4141}}}
    4242
     43The required constructors for any of the multi-page viewers are shown below:
     44
     45{{{
     46public class MassSpecMultiPageViewer extends CancelableMultiPageEditor implements IPropertyChangeListener {
     47 
     48        ...
     49
     50        @Inject
     51        public MassSpecMultiPageViewer(Entry entry) {
     52                super();
     53                this.entry = entry;
     54                ...
     55               
     56        }
     57       
     58        @Inject
     59        public MassSpecMultiPageViewer (MPart part) {
     60                super();
     61                this.entry = (Entry) part.getTransientData().get(IGritsUIService.TRANSIENT_DATA_KEY_PART_ENTRY);
     62                ...
     63        }
     64       
     65        ...
     66}
     67}}}
     68
     69The second constructor which gets the entry from the part's transient data is necessary since we also create these editors through commands (not only with "double-click" from the project explorer). "Double-click" from the project explorer handles setting the transient data to make it possible to match the part with the given input (Entry). However, there is no notion of active Entry selection when we open the part with a double-click on the tables. In such a case, we have to get the related Entry from the part's transient data.
     70
     71Another special case for the ms plugins is that the multi-page viewers have a parent/child relationship. The top-level viewer is matched with an Entry with a certain property (which is defined as a "category" for the part descriptor in fragment.4xmi) and the child multi-page viewers display Entries with a child property of the parent viewer. In order to handle this case, we define the same multi-page viewer twice as a part descriptor in fragment.4xmi with a different id. For the child multi-page viewer, the "category" should list the child property's id. An example (fragment.4xmi) from "entry.ms" plugin is shown below:
     72
     73{{{
     74<fragments xsi:type="fragment:StringModelFragment" xmi:id="_tcuOcJrFEeaQyJVS-36HMg" featurename="descriptors" parentElementId="org.grits.toolbox.core.application">
     75    <elements xsi:type="basic:PartDescriptor" xmi:id="_wCsLIJrFEeaQyJVS-36HMg" elementId="plugin.ms.annotation.views.MassSpecMultiPageViewer" label="Mass Spec Overview" iconURI="platform:/plugin/org.grits.toolbox.entry.ms/icons/massspectrum.png" bindingContexts="_hdfcUJrFEeaQyJVS-36HMg" allowMultiple="true" category="org.grits.toolbox.property.ms" closeable="true" dirtyable="true" contributionURI="bundleclass://org.grits.toolbox.entry.ms/org.grits.toolbox.entry.ms.views.tabbed.MassSpecMultiPageViewer">
     76      <tags>default</tags>
     77      <tags>removeOnHide</tags>
     78    </elements>
     79    <elements xsi:type="basic:PartDescriptor" xmi:id="_A10RgJxwEeaQyJVS-36HMg" elementId="plugin.ms.annotation.views.MassSpecMultiPageViewer2" label="Mass Spec Scan View" iconURI="platform:/plugin/org.grits.toolbox.entry.ms/icons/massspectrum.png" bindingContexts="_hdfcUJrFEeaQyJVS-36HMg" allowMultiple="true" category="org.grits.toolbox.entry.ms.property.MassSpecProperty" closeable="true" dirtyable="true" contributionURI="bundleclass://org.grits.toolbox.entry.ms/org.grits.toolbox.entry.ms.views.tabbed.MassSpecMultiPageViewer">
     80      <tags>default</tags>
     81      <tags>removeOnHide</tags>
     82    </elements>
     83  </fragments>
     84}}}
     85
     86
    4387== Migrating the pages ==
    4488
    45 Pages (tabs) of the multi-page viewers in MS plugins extend from either EntryEditorPart or ScrollableEntryEditorPart or implement IEntryEditorPart interface. In all cases, their input is the Entry object and it needs to be injected (through the constructor) for most of these pages.
     89Pages (tabs) of the multi-page viewers in MS plugins extend from either EntryEditorPart or ScrollableEntryEditorPart or implement IEntryEditorPart interface. In all cases, their input is the Entry object and it needs to be injected (through the constructor) for most of these pages. For the most part, the Entry is the minimum that needs to be injected but many of the pages require several other objects to be set in their constructor. As mentioned above, these objects should be set in the context before creation (with ContextInjectionFactory.make) of such pages.
    4690
    4791{{{