Class GraphicalEditor

    • Constructor Detail

      • GraphicalEditor

        public GraphicalEditor()
        Constructs the editor part
    • Method Detail

      • commandStackChanged

        public void commandStackChanged​(java.util.EventObject event)
        When the command stack changes, the actions interested in the command stack are updated.
        Specified by:
        commandStackChanged in interface CommandStackListener
        Parameters:
        event - the change event
      • configureGraphicalViewer

        protected void configureGraphicalViewer()
        Called to configure the graphical viewer before it receives its contents. This is where the root editpart should be configured. Subclasses should extend or override this method as needed.
      • createActions

        protected void createActions()
        Creates actions for this editor. Subclasses should override this method to create and register actions with the ActionRegistry.
      • createGraphicalViewer

        protected void createGraphicalViewer​(Composite parent)
        Creates the GraphicalViewer on the specified Composite.
        Parameters:
        parent - the parent composite
      • getActionRegistry

        protected ActionRegistry getActionRegistry()
        Lazily creates and returns the action registry.
        Returns:
        the action registry
      • getCommandStack

        protected CommandStack getCommandStack()
        Returns the command stack.
        Returns:
        the command stack
      • getEditDomain

        protected DefaultEditDomain getEditDomain()
        Returns the edit domain.
        Returns:
        the edit domain
      • getGraphicalViewer

        protected GraphicalViewer getGraphicalViewer()
        Returns the graphical viewer.
        Returns:
        the graphical viewer
      • getPropertyActions

        protected java.util.List getPropertyActions()
        Returns the list of IActions dependant on property changes in the Editor. These actions should implement the UpdateAction interface so that they can be updated in response to property changes. An example is the "Save" action.
        Returns:
        the list of property-dependant actions
      • getSelectionActions

        protected java.util.List getSelectionActions()
        Returns the list of IDs of Actions that are dependant on changes in the workbench's ISelectionService. The associated Actions can be found in the action registry. Such actions should implement the UpdateAction interface so that they can be updated in response to selection changes.
        Returns:
        the list of selection-dependant action IDs
        See Also:
        updateActions(List)
      • getSelectionSynchronizer

        protected SelectionSynchronizer getSelectionSynchronizer()
        Returns the selection syncronizer object. The synchronizer can be used to sync the selection of 2 or more EditPartViewers.
        Returns:
        the syncrhonizer
      • getStackActions

        protected java.util.List getStackActions()
        Returns the list of IDs of Actions that are dependant on the CommmandStack's state. The associated Actions can be found in the action registry. These actions should implement the UpdateAction interface so that they can be updated in response to command stack changes. An example is the "undo" action.
        Returns:
        the list of stack-dependant action IDs
      • hookGraphicalViewer

        protected void hookGraphicalViewer()
        Hooks the GraphicalViewer to the rest of the Editor. By default, the viewer is added to the SelectionSynchronizer, which can be used to keep 2 or more EditPartViewers in sync. The viewer is also registered as the ISelectionProvider for the Editor's PartSite.
      • initializeGraphicalViewer

        protected abstract void initializeGraphicalViewer()
        Override to set the contents of the GraphicalViewer after it has been created.
        See Also:
        createGraphicalViewer(Composite)
      • setActionRegistry

        protected void setActionRegistry​(ActionRegistry registry)
        Sets the ActionRegistry for this EditorPart.
        Parameters:
        registry - the registry
      • setEditDomain

        protected void setEditDomain​(DefaultEditDomain ed)
        Sets the EditDomain for this EditorPart.
        Parameters:
        ed - the domain
      • setGraphicalViewer

        protected void setGraphicalViewer​(GraphicalViewer viewer)
        Sets the graphicalViewer for this EditorPart.
        Parameters:
        viewer - the graphical viewer
      • updateActions

        protected void updateActions​(java.util.List actionIds)
        A convenience method for updating a set of actions defined by the given List of action IDs. The actions are found by looking up the ID in the action registry. If the corresponding action is an UpdateAction, it will have its update() method called.
        Parameters:
        actionIds - the list of IDs to update