- java.lang.Object
-
- javax.swing.undo.AbstractUndoableEdit
-
- javax.swing.undo.CompoundEdit
-
- javax.swing.undo.UndoManager
-
- com.iamsoft.util.ui.undo.JshiftUndoManager
-
- All Implemented Interfaces:
ExposedCompoundEdit
,Serializable
,EventListener
,UndoableEditListener
,TreeModel
,UndoableEdit
public class JshiftUndoManager extends UndoManager implements ExposedCompoundEdit, TreeModel
Adds support for UndoListeners and makes a couple methods public.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class javax.swing.undo.CompoundEdit
edits
-
Fields inherited from class javax.swing.undo.AbstractUndoableEdit
RedoName, UndoName
-
-
Constructor Summary
Constructors Constructor Description JshiftUndoManager()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
addEdit(UndoableEdit pEdit)
void
addTreeModelListener(TreeModelListener pListener)
void
addUndoOrRedoListener(UndoOrRedoListener pListener)
static SortedMap
decompose(ExposedCompoundEdit pCompoundEdit)
Get a map where the key is an UndoableEdit and the value is another SortedMap with an entry for each sub-edit.UndoableEdit
editToBeRedone()
Make method public.UndoableEdit
editToBeUndone()
Make method public.void
fireTreeNodesInserted()
void
fireTreeStructureChanged()
Object
getChild(Object pParent, int pIdx)
int
getChildCount(Object pParent)
Vector<UndoableEdit>
getEdits()
int
getIndex()
Current location in edit vector.int
getIndexOfChild(Object pParent, Object pChild)
Object
getRoot()
boolean
isAcceptingEdits()
If false, addEdit will have no effect and will return false.boolean
isLeaf(Object pNode)
void
redo()
void
refreshDecomposition()
void
removeTreeModelListener(TreeModelListener pListener)
void
removeUndoOrRedoListener(UndoOrRedoListener pListener)
void
setAcceptingEdits(boolean pAcceptingEdits)
String
toString()
void
undo()
void
valueForPathChanged(TreePath pPath, Object pNewValue)
-
Methods inherited from class javax.swing.undo.UndoManager
canRedo, canUndo, canUndoOrRedo, discardAllEdits, end, getLimit, getRedoPresentationName, getUndoOrRedoPresentationName, getUndoPresentationName, redoTo, setLimit, trimEdits, trimForLimit, undoableEditHappened, undoOrRedo, undoTo
-
Methods inherited from class javax.swing.undo.CompoundEdit
die, getPresentationName, isInProgress, isSignificant, lastEdit
-
Methods inherited from class javax.swing.undo.AbstractUndoableEdit
replaceEdit
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface javax.swing.undo.UndoableEdit
canRedo, canUndo, die, getPresentationName, getRedoPresentationName, getUndoPresentationName, isSignificant, replaceEdit
-
-
-
-
Method Detail
-
isAcceptingEdits
public boolean isAcceptingEdits()
If false, addEdit will have no effect and will return false.
-
setAcceptingEdits
public void setAcceptingEdits(boolean pAcceptingEdits)
- See Also:
isAcceptingEdits()
-
getEdits
public Vector<UndoableEdit> getEdits()
- Specified by:
getEdits
in interfaceExposedCompoundEdit
-
getIndex
public int getIndex()
Current location in edit vector.- See Also:
UndoManager.indexOfNextAdd
-
addEdit
public boolean addEdit(UndoableEdit pEdit)
- Specified by:
addEdit
in interfaceUndoableEdit
- Overrides:
addEdit
in classUndoManager
-
editToBeUndone
public UndoableEdit editToBeUndone()
Make method public.- Overrides:
editToBeUndone
in classUndoManager
-
editToBeRedone
public UndoableEdit editToBeRedone()
Make method public.- Overrides:
editToBeRedone
in classUndoManager
-
undo
public void undo()
- Specified by:
undo
in interfaceUndoableEdit
- Overrides:
undo
in classUndoManager
-
redo
public void redo()
- Specified by:
redo
in interfaceUndoableEdit
- Overrides:
redo
in classUndoManager
-
addUndoOrRedoListener
public void addUndoOrRedoListener(UndoOrRedoListener pListener)
-
removeUndoOrRedoListener
public void removeUndoOrRedoListener(UndoOrRedoListener pListener)
-
decompose
public static SortedMap decompose(ExposedCompoundEdit pCompoundEdit)
Get a map where the key is an UndoableEdit and the value is another SortedMap with an entry for each sub-edit.
-
refreshDecomposition
public void refreshDecomposition()
-
toString
public String toString()
- Overrides:
toString
in classUndoManager
-
getChildCount
public int getChildCount(Object pParent)
- Specified by:
getChildCount
in interfaceTreeModel
-
valueForPathChanged
public void valueForPathChanged(TreePath pPath, Object pNewValue)
- Specified by:
valueForPathChanged
in interfaceTreeModel
-
getIndexOfChild
public int getIndexOfChild(Object pParent, Object pChild)
- Specified by:
getIndexOfChild
in interfaceTreeModel
-
addTreeModelListener
public void addTreeModelListener(TreeModelListener pListener)
- Specified by:
addTreeModelListener
in interfaceTreeModel
-
removeTreeModelListener
public void removeTreeModelListener(TreeModelListener pListener)
- Specified by:
removeTreeModelListener
in interfaceTreeModel
-
fireTreeStructureChanged
public void fireTreeStructureChanged()
-
fireTreeNodesInserted
public void fireTreeNodesInserted()
-
-