Interface IFeature

    • Method Detail

      • isAvailable

        boolean isAvailable​(IContext context)
        Decides if the current feature is available with the given context.
        Parameters:
        context - this is the general input for this method
        Returns:
        true if it is available, false if not
        See Also:
        IContext
      • canExecute

        boolean canExecute​(IContext context)
        Decides if the current feature can execute with the given context.
        Parameters:
        context - this is the general input for this method
        Returns:
        true if the feature can be executed, false if not
        See Also:
        IContext
      • execute

        void execute​(IContext context)
        Executes the current feature with the given context.
        Parameters:
        context - this is the general input for this method
        See Also:
        IContext
      • canUndo

        boolean canUndo​(IContext context)
        Decides if the current feature can be undone - this is the undo of the execute operation.
        Parameters:
        context - this is the general input for this method
        Returns:
        true if the feature can be undone, false if not
        See Also:
        IContext
      • hasDoneChanges

        boolean hasDoneChanges()
        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.

        Returns:
        true if the feature should appear in the undo stack, false otherwise