ides.api.undo
Interface UndoManager


public interface UndoManager

Interface to the IDES UndoManager. The manager is responsible for undoing and redoing undoable actions. It automatically manages the undo stacks for the many models that may be opened in a workspace. Registered UI elements are automatically updated with the changing status of the undo system.

Author:
Lenko Grigorov

Method Summary
 void addEdit(DESModel model, javax.swing.undo.UndoableEdit edit)
          Adds an UndoableEdit to the undo stack of the specified model, if the model is loaded in the workspace.
 void addEdit(javax.swing.undo.UndoableEdit edit)
          Adds an UndoableEdit to the undo stack of the active model.
 void bindNoTextRedo(javax.swing.AbstractButton element)
          Registers an AbstractButton to be updated when the undo state changes.
 void bindNoTextUndo(javax.swing.AbstractButton element)
          Registers an AbstractButton to be updated when the undo state changes.
 void bindRedo(javax.swing.AbstractButton element)
          Registers an AbstractButton to be updated when the undo state changes.
 void bindUndo(javax.swing.AbstractButton element)
          Registers an AbstractButton to be updated when the undo state changes.
 javax.swing.AbstractAction getRedoAction()
          Returns an action which redoes the last undone entry in the undo manager, if any.
 javax.swing.AbstractAction getUndoAction()
          Returns an action which undoes the last entry in the undo manager, if any.
 void unbind(javax.swing.AbstractButton element)
          Unregisters an AbstractButton so that it is no longer updated when the undo state changes.
 

Method Detail

addEdit

void addEdit(javax.swing.undo.UndoableEdit edit)
Adds an UndoableEdit to the undo stack of the active model.


addEdit

void addEdit(DESModel model,
             javax.swing.undo.UndoableEdit edit)
Adds an UndoableEdit to the undo stack of the specified model, if the model is loaded in the workspace. If the model is not in the workspace, does nothing.

Parameters:
model - model in whose undo stack the edit should be added
edit - the edit to be added in the undo stack

bindUndo

void bindUndo(javax.swing.AbstractButton element)
Registers an AbstractButton to be updated when the undo state changes. The text of the UI element will be updated.

Parameters:
element - the UI element to be registered for automatic updates

bindNoTextUndo

void bindNoTextUndo(javax.swing.AbstractButton element)
Registers an AbstractButton to be updated when the undo state changes. The text of the UI element will not be updated.

Parameters:
element - the UI element to be registered for automatic updates

bindRedo

void bindRedo(javax.swing.AbstractButton element)
Registers an AbstractButton to be updated when the undo state changes. The text of the UI element will be updated.

Parameters:
element - the UI element to be registered for automatic updates

bindNoTextRedo

void bindNoTextRedo(javax.swing.AbstractButton element)
Registers an AbstractButton to be updated when the undo state changes. The text of the UI element will not be updated.

Parameters:
element - the UI element to be registered for automatic updates

unbind

void unbind(javax.swing.AbstractButton element)
Unregisters an AbstractButton so that it is no longer updated when the undo state changes.

Parameters:
element - the UI element to be unregistered from automatic updates

getUndoAction

javax.swing.AbstractAction getUndoAction()
Returns an action which undoes the last entry in the undo manager, if any.

Returns:
an action which undoes the last entry in the undo manager

getRedoAction

javax.swing.AbstractAction getRedoAction()
Returns an action which redoes the last undone entry in the undo manager, if any.

Returns:
an action which redoes the last undone entry in the undo manager