- 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 booleanaddEdit(UndoableEdit pEdit)voidaddTreeModelListener(TreeModelListener pListener)voidaddUndoOrRedoListener(UndoOrRedoListener pListener)static SortedMapdecompose(ExposedCompoundEdit pCompoundEdit)Get a map where the key is an UndoableEdit and the value is another SortedMap with an entry for each sub-edit.UndoableEditeditToBeRedone()Make method public.UndoableEditeditToBeUndone()Make method public.voidfireTreeNodesInserted()voidfireTreeStructureChanged()ObjectgetChild(Object pParent, int pIdx)intgetChildCount(Object pParent)Vector<UndoableEdit>getEdits()intgetIndex()Current location in edit vector.intgetIndexOfChild(Object pParent, Object pChild)ObjectgetRoot()booleanisAcceptingEdits()If false, addEdit will have no effect and will return false.booleanisLeaf(Object pNode)voidredo()voidrefreshDecomposition()voidremoveTreeModelListener(TreeModelListener pListener)voidremoveUndoOrRedoListener(UndoOrRedoListener pListener)voidsetAcceptingEdits(boolean pAcceptingEdits)StringtoString()voidundo()voidvalueForPathChanged(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:
getEditsin interfaceExposedCompoundEdit
-
getIndex
public int getIndex()
Current location in edit vector.- See Also:
UndoManager.indexOfNextAdd
-
addEdit
public boolean addEdit(UndoableEdit pEdit)
- Specified by:
addEditin interfaceUndoableEdit- Overrides:
addEditin classUndoManager
-
editToBeUndone
public UndoableEdit editToBeUndone()
Make method public.- Overrides:
editToBeUndonein classUndoManager
-
editToBeRedone
public UndoableEdit editToBeRedone()
Make method public.- Overrides:
editToBeRedonein classUndoManager
-
undo
public void undo()
- Specified by:
undoin interfaceUndoableEdit- Overrides:
undoin classUndoManager
-
redo
public void redo()
- Specified by:
redoin interfaceUndoableEdit- Overrides:
redoin 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:
toStringin classUndoManager
-
getChildCount
public int getChildCount(Object pParent)
- Specified by:
getChildCountin interfaceTreeModel
-
valueForPathChanged
public void valueForPathChanged(TreePath pPath, Object pNewValue)
- Specified by:
valueForPathChangedin interfaceTreeModel
-
getIndexOfChild
public int getIndexOfChild(Object pParent, Object pChild)
- Specified by:
getIndexOfChildin interfaceTreeModel
-
addTreeModelListener
public void addTreeModelListener(TreeModelListener pListener)
- Specified by:
addTreeModelListenerin interfaceTreeModel
-
removeTreeModelListener
public void removeTreeModelListener(TreeModelListener pListener)
- Specified by:
removeTreeModelListenerin interfaceTreeModel
-
fireTreeStructureChanged
public void fireTreeStructureChanged()
-
fireTreeNodesInserted
public void fireTreeNodesInserted()
-
-