Changes between Version 1 and Version 2 of Grits_Classes_3_x_to_E4


Ignore:
Timestamp:
04/14/2016 10:56:01 PM (7 years ago)
Author:
shan
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Grits_Classes_3_x_to_E4

    v1 v2  
    11= Change in available classes and methods from core plugin =
     2== Classes (and their methods) that are not available ==
     3=== ProjectExplorerView ===
     4'''ProjectExplorerView''' class (''org.grits.toolbox.core.projectexplorer.view.ProjectExplorerView'') replaced with '''ProjectExplorerPart''' class (''org.grits.toolbox.core.projectexplorer.part.ProjectExplorerPart'')
     5
     6==== __Fixing your plugin__ ====
     7===== __3.x plugins__ =====
     8method ''ProjectExplorerView.getClickedEntry()'' should be replaced with ''HandlerUtil.getActiveMenuSelection(event)'' in case of commands using project explorer's current selection
     9
     10===== __e4 plugins__ =====
     11- should use ESelectionService (or ''@Named(IServiceConstants.ACTIVE_SELECTION)''). Below is an example code
     12{{{
     13        // example 1
     14        @CanExecute
     15        public boolean canExecute(@Named(IServiceConstants.ACTIVE_SELECTION) Object object)
     16        {
     17                return object instanceof Entry && ((Entry) object).getProperty().isRenamable();
     18        }
     19
     20        // example 2
     21        @CanExecute
     22        public boolean canExecute(@Named(IServiceConstants.ACTIVE_SELECTION) Object object)
     23        {
     24                return object instanceof Entry || object instanceof StructuredSelection;
     25        }
     26
     27}}}
     28__Note__
     29- When current selection is a single entry
     30 - selection is an object of type ''Entry'' (''org.grits.toolbox.core.datamodel.Entry'')
     31- When current selection is a list of entries
     32 - selection is an object of type ''StructuredSelection'' (''org.eclipse.jface.viewers.StructuredSelection'')
     33
     34
     35== Deprecated Classes and methods ==
     36=== DataModelHandler ===
     37- uses '''IGritsDataModelService''' internally
     38
     39=== PropertyHandler ===
     40- uses '''IGritsDataModelService''' internally
     41- root workspace entry is also injected to appplication
     42
     43=== EditorHandler ===
     44==== __e4 plugins__ ====
     45- should use '''IGritsUIService''' instead