Interface ILcdUndoable

All Superinterfaces:
ILcdPropertyChangeSource
All Known Implementing Classes:
ALcdUndoable, TLcdCompositeUndoable

public interface ILcdUndoable extends ILcdPropertyChangeSource

This interface describes objects that implement undo and redo behavior. When actions want to support a undo/redo mechanism, they should generate these kinds of objects and notify an ILcdUndoableListener that an undoable event has happened. This listener can than for instance provide actions to undo these events.

See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Adds aUndoable to this ILcdUndoable.
    boolean
    Returns whether or not this ILcdUndoable can be redone.
    boolean
    Returns whether or not this ILcdUndoable can be undone.
    void
    die()
    Method that might be invoked to allow for cleanup tasks.
    Returns the display name of this ILcdUndoable.
    Returns the redo display name of this ILcdUndoable.
    Returns the undo display name of this ILcdUndoable.
    boolean
    Returns false if this ILcdUndoable is insignificant--for example one that maintains the user's selection, but does not change any model state.
    void
    Redoes the operation represented by this ILcdUndoable.
    void
    Undoes the operation represented by this ILcdUndoable.

    Methods inherited from interface com.luciad.util.ILcdPropertyChangeSource

    addPropertyChangeListener, removePropertyChangeListener
  • Method Details

    • undo

      void undo() throws TLcdCannotUndoRedoException
      Undoes the operation represented by this ILcdUndoable.
      Throws:
      TLcdCannotUndoRedoException
    • redo

      void redo() throws TLcdCannotUndoRedoException
      Redoes the operation represented by this ILcdUndoable.
      Throws:
      TLcdCannotUndoRedoException
    • canUndo

      boolean canUndo()
      Returns whether or not this ILcdUndoable can be undone.
      Returns:
      Whether or not this ILcdUndoable can be undone.
    • canRedo

      boolean canRedo()
      Returns whether or not this ILcdUndoable can be redone.
      Returns:
      Whether or not this ILcdUndoable can be redone.
    • getDisplayName

      String getDisplayName()
      Returns the display name of this ILcdUndoable. It can for example be used for logging purposes.
    • getRedoDisplayName

      String getRedoDisplayName()
      Returns the redo display name of this ILcdUndoable. It can for example be used as the text of a menu item.
      Returns:
      The redo display name
    • getUndoDisplayName

      String getUndoDisplayName()
      Returns the undo display name of this ILcdUndoable. It can for example be used as the text of a menu item.
    • isSignificant

      boolean isSignificant()
      Returns false if this ILcdUndoable is insignificant--for example one that maintains the user's selection, but does not change any model state. This status can be used by an ILcdUndoableListener (like TLcdUndoManager) when deciding which ILcdUndoables to present to the user as Undo/Redo options, and which to perform as side effects of undoing or redoing other events.
      Returns:
      Whether or not this ILcdUndoable is significant.
    • die

      void die()
      Method that might be invoked to allow for cleanup tasks. For instance I/O streams could be closed here.
    • addUndoable

      boolean addUndoable(ILcdUndoable aUndoable)

      Adds aUndoable to this ILcdUndoable. If aUndoable cannot be added, this method should return false.

      This mechanism allows you to collapse multiple ILcdUndoables into one. For instance when typing, you may or may not want every single keystroke to be separately undoable, but instead to undo a series of keystrokes that were within a certain time of each other.

      Parameters:
      aUndoable - The undoable to add to this ILcdUndoable.
      Returns:
      Whether or not aUndoable was accepted by this ILcdUndoable.