Class DefaultUpdateDiagramFeature

    • Method Detail

      • canUpdate

        public boolean canUpdate​(IUpdateContext context)
        Description copied from interface: IUpdate
        Checks whether the values of the current pictogram element of the given context can be updated.
        Specified by:
        canUpdate in interface IUpdate
        Parameters:
        context - the context
        Returns:
        true if update is possible
      • update

        public boolean update​(IUpdateContext context)
        Description copied from interface: IUpdate
        Updates the pictogram element. It copies the latest values from the business model to the graphics algorithm of this pictogram elements.
        Specified by:
        update in interface IUpdate
        Parameters:
        context - the context
        Returns:
        true, if update process was successfull
      • updateNeeded

        public IReason updateNeeded​(IUpdateContext context)
        Description copied from interface: IUpdate
        Check whether the values in the pictogram element are up to date, that means whether the graphics algorithm of this pictogram element contain the latest values from the business objects.
        Specified by:
        updateNeeded in interface IUpdate
        Parameters:
        context - the context
        Returns:
        true if parts of the pictogram model needs to be updated with the latest values from the business model
      • hasDoneChanges

        public boolean hasDoneChanges()
        Description copied from interface: IFeature
        Is queried by the framework after a feature has been executed to find out if this feature should appear in the undo stack of e.g. an editor. By default all features should appear there (see implementation in AbstractFeature), but features may decide to override this behavior. Note that this is a dynamic attribute of the feature that is queried each time after the feature has been executed.

        IMPORTANT NOTE: The implementor of the feature is responsible for correctly implementing this method! It might lead to inconsistencies in the command stack if this method returns false although the feature did changes.

        Specified by:
        hasDoneChanges in interface IFeature
        Overrides:
        hasDoneChanges in class AbstractFeature
        Returns:
        true if the feature should appear in the undo stack, false otherwise
      • canUndo

        public boolean canUndo​(IContext context)
        Description copied from interface: IFeature
        Decides if the current feature can be undone - this is the undo of the execute operation.
        Specified by:
        canUndo in interface ICustomUndoRedoFeature
        Specified by:
        canUndo in interface IFeature
        Overrides:
        canUndo in class AbstractFeature
        Parameters:
        context - this is the general input for this method
        Returns:
        true if the feature can be undone, false if not
        Since:
        0.12
        See Also:
        IContext
      • canRedo

        public boolean canRedo​(IContext context)
        Description copied from interface: ICustomUndoRedoFeature
        Decides if the processed feature can be re-done. This method is called once by the Graphiti framework just before any redo work is started, e.g. before ICustomUndoRedoFeature.preRedo(IContext).

        Note that as soon as any feature reports false here, also all consecutive entries in the command stack are no longer reachable for redo.

        Specified by:
        canRedo in interface ICustomUndoRedoFeature
        Parameters:
        context - this is the instance of the IContext object that was in use when executing the feature
        Returns:
        true if the feature can be re-done, false if not
        Since:
        0.12
      • preRedo

        public void preRedo​(IContext context)
        Description copied from interface: ICustomUndoRedoFeature
        This method will be called by the Graphiti framework before the EMF undo has triggered. Customers may re-apply their non-EMF changes done by the feature here or in ICustomUndoRedoFeature.postRedo(IContext). (Usually it might be sufficient to delegate to the execution method of the feature.)
        Specified by:
        preRedo in interface ICustomUndoRedoFeature
        Parameters:
        context - this is the instance of the IContext object that was in use when executing the feature
        Since:
        0.12
      • postRedo

        public void postRedo​(IContext context)
        Description copied from interface: ICustomUndoRedoFeature
        This method will be called by the Graphiti framework after the EMF undo has finished. Customers may re-apply their non-EMF changes done by the feature here or in ICustomUndoRedoFeature.preRedo(IContext). (Usually it might be sufficient to delegate to the execution method of the feature.)
        Specified by:
        postRedo in interface ICustomUndoRedoFeature
        Parameters:
        context - this is the instance of the IContext object that was in use when executing the feature
        Since:
        0.12