Class SNodeUndoableAction


  • public abstract class SNodeUndoableAction
    extends Object
    • Constructor Detail

      • SNodeUndoableAction

        protected SNodeUndoableAction​(SNode affectedNode)
    • Method Detail

      • getAffectedNode

        public SNode getAffectedNode()
      • hasVirtualFile

        @Deprecated
        public boolean hasVirtualFile()
        Deprecated.
        since MPS 2017.3 all undo actions are associated with virtual files. Not used anymore.
      • getAssociatedVfsChange

        public SNodeUndoableAction.VFSChange getAssociatedVfsChange()
        Some SNodeUndoableActions may cause VFS state change. For example, new root node creation may potentially cause new VirtualFile creation. Root deletion, in turn, VirtualFile deletion. Such actions should return corresponding SNodeUndoableAction.VFSChange member in order to indicate that VFS state may require update during undo/redo operations for such actions.

        It is supposed that only single file may be affected by such actions. This means, there is only one (same) virtual file available in NodeVirtualFileSystem for the node (all nodes), returned from UndoContext.getVirtualFileNodes() for such actions.

        Returns:
        FILE_CREATED or FILE_DELETED for AddRootUndoableAction or RemoveRootUndoableAction in accordance.
      • doUndo

        protected abstract void doUndo()
      • doRedo

        protected abstract void doRedo()
      • undo

        public final void undo()
      • redo

        public final void redo()