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 voidaddUndoableEditListener(UndoableEditListener listener)Adds an undoable edit listener.booleancanRedo()booleancanUndo()UndoableEditListener[]getUndoableEditListeners()Gets the array of all undoable edit listeners.UndoManagergetUndoManager()voidpostEdit(UndoableEdit edit)Posts an undoable edit.voidredo()voidremoveUndoableEditListener(UndoableEditListener listener)Removes an undoable edit listener.voidundo()
-
-
-
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:
canUndoin interfaceUndoContext
-
undo
public void undo()
- Specified by:
undoin interfaceUndoContext
-
canRedo
public boolean canRedo()
- Specified by:
canRedoin interfaceUndoContext
-
redo
public void redo()
- Specified by:
redoin interfaceUndoContext
-
postEdit
public void postEdit(UndoableEdit edit)
Description copied from interface:UndoContextPosts an undoable edit. Listeners will be notified.- Specified by:
postEditin interfaceUndoContext- Parameters:
edit- The undoable edit.
-
addUndoableEditListener
public void addUndoableEditListener(UndoableEditListener listener)
Description copied from interface:UndoContextAdds an undoable edit listener.- Specified by:
addUndoableEditListenerin interfaceUndoContext- Parameters:
listener- The listener.
-
removeUndoableEditListener
public void removeUndoableEditListener(UndoableEditListener listener)
Description copied from interface:UndoContextRemoves an undoable edit listener.- Specified by:
removeUndoableEditListenerin interfaceUndoContext- Parameters:
listener- The listener.
-
getUndoableEditListeners
public UndoableEditListener[] getUndoableEditListeners()
Description copied from interface:UndoContextGets the array of all undoable edit listeners.- Specified by:
getUndoableEditListenersin interfaceUndoContext- Returns:
- The array of listeners or an empty array if no listeners have been added
-
-