Package com.bc.ceres.swing.undo.support
Class DefaultUndoContext
java.lang.Object
com.bc.ceres.swing.undo.support.DefaultUndoContext
- All Implemented Interfaces:
UndoContext
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultUndoContext
(Object source) DefaultUndoContext
(Object source, UndoManager undoManager) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addUndoableEditListener
(UndoableEditListener listener) Adds an undoable edit listener.boolean
canRedo()
boolean
canUndo()
Gets the array of all undoable edit listeners.void
postEdit
(UndoableEdit edit) Posts an undoable edit.void
redo()
void
Removes an undoable edit listener.void
undo()
-
Constructor Details
-
DefaultUndoContext
-
DefaultUndoContext
-
-
Method Details
-
getUndoManager
-
canUndo
public boolean canUndo()- Specified by:
canUndo
in interfaceUndoContext
-
undo
public void undo()- Specified by:
undo
in interfaceUndoContext
-
canRedo
public boolean canRedo()- Specified by:
canRedo
in interfaceUndoContext
-
redo
public void redo()- Specified by:
redo
in interfaceUndoContext
-
postEdit
Description copied from interface:UndoContext
Posts an undoable edit. Listeners will be notified.- Specified by:
postEdit
in interfaceUndoContext
- Parameters:
edit
- The undoable edit.
-
addUndoableEditListener
Description copied from interface:UndoContext
Adds an undoable edit listener.- Specified by:
addUndoableEditListener
in interfaceUndoContext
- Parameters:
listener
- The listener.
-
removeUndoableEditListener
Description copied from interface:UndoContext
Removes an undoable edit listener.- Specified by:
removeUndoableEditListener
in interfaceUndoContext
- Parameters:
listener
- The listener.
-
getUndoableEditListeners
Description copied from interface:UndoContext
Gets the array of all undoable edit listeners.- Specified by:
getUndoableEditListeners
in interfaceUndoContext
- Returns:
- The array of listeners or an empty array if no listeners have been added
-