Package com.bc.ceres.swing.undo.support
Class DefaultUndoContext
- java.lang.Object
-
- com.bc.ceres.swing.undo.support.DefaultUndoContext
-
- All Implemented Interfaces:
UndoContext
public class DefaultUndoContext extends Object implements UndoContext
-
-
Constructor Summary
Constructors Constructor Description DefaultUndoContext(Object source)
DefaultUndoContext(Object source, UndoManager undoManager)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addUndoableEditListener(UndoableEditListener listener)
Adds an undoable edit listener.boolean
canRedo()
boolean
canUndo()
UndoableEditListener[]
getUndoableEditListeners()
Gets the array of all undoable edit listeners.UndoManager
getUndoManager()
void
postEdit(UndoableEdit edit)
Posts an undoable edit.void
redo()
void
removeUndoableEditListener(UndoableEditListener listener)
Removes an undoable edit listener.void
undo()
-
-
-
Constructor Detail
-
DefaultUndoContext
public DefaultUndoContext(Object source)
-
DefaultUndoContext
public DefaultUndoContext(Object source, UndoManager undoManager)
-
-
Method Detail
-
getUndoManager
public UndoManager 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
public void postEdit(UndoableEdit edit)
Description copied from interface:UndoContext
Posts an undoable edit. Listeners will be notified.- Specified by:
postEdit
in interfaceUndoContext
- Parameters:
edit
- The undoable edit.
-
addUndoableEditListener
public void addUndoableEditListener(UndoableEditListener listener)
Description copied from interface:UndoContext
Adds an undoable edit listener.- Specified by:
addUndoableEditListener
in interfaceUndoContext
- Parameters:
listener
- The listener.
-
removeUndoableEditListener
public void removeUndoableEditListener(UndoableEditListener listener)
Description copied from interface:UndoContext
Removes an undoable edit listener.- Specified by:
removeUndoableEditListener
in interfaceUndoContext
- Parameters:
listener
- The listener.
-
getUndoableEditListeners
public UndoableEditListener[] 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
-
-