Class CompositeOperation

    • Constructor Detail

      • CompositeOperation

        public CompositeOperation​(String label,
                                  SheetAccessor sheet)
        Creates new instance of CompositeOperation. In case of using this constructor, selection will not be swapped while performing undo/redo.
        Parameters:
        label - operation label, must not be null
        undoContext - undo context, may be null
        sheet - SheetAccessor, must not be null
      • CompositeOperation

        public CompositeOperation​(String label,
                                  SheetAccessor sheet,
                                  MoxelControl control)
        Creates new instance of CompositeOperation. In case of using this constructor, selection will be swapped while performing undo/redo.
        Parameters:
        label - operation label, must not be null
        undoContext - undo context, may be null
        sheet - SheetAccessor, must not be null
        control - MoxelControl, may be null. In case of non-null value selection will be swapped while performing undo/redo
    • Method Detail

      • addOperation

        public void addOperation​(BaseOperation operation)
        Add operation for execution.
        Parameters:
        operation - operation to be added
      • execute

        public Void execute​(IBmTransaction transaction,
                            org.eclipse.core.runtime.IProgressMonitor progressMonitor)
        Description copied from interface: IBmTask

        The method called by the task executor with an active transaction. The method code must not commit or rollback the transaction.

        If the task is not supposed to return a result, then it may be parameterized with Void and return null.

        Parameters:
        transaction - The active transaction. May not be null.
        progressMonitor - The monitor to indicate the progress. May not be null.
        Returns:
        execution result, may be null.
      • onUndo

        public void onUndo()
        Description copied from interface: IBmPostUndoRedoHandler
        The method invoked after the task is undone.
      • onRedo

        public void onRedo()
        Description copied from interface: IBmPostUndoRedoHandler
        The method invoked after the task is redone.
      • onExecute

        public void onExecute()
        Description copied from class: BaseOperation
        The method invoked outside the transaction after the 'execute' method.
        Specified by:
        onExecute in class BaseOperation
      • isReadOnly

        public boolean isReadOnly()
        Description copied from class: BaseOperation
        Checks if the operation is read-only.
        Specified by:
        isReadOnly in class BaseOperation
        Returns:
        true if the operation is read-only, false otherwise.