|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.merlotxml.merlot.MerlotUndoableEdit
Field Summary | |
protected int |
_action
|
protected MerlotDOMNode |
_node
For deletes this is the only node, For moves, this is the node being moved. |
protected int[] |
_nodeLocation
this is basically a TreePath with child indices instead of object refs of where the node used to be before being deleted or moved. |
protected java.lang.String |
_presName
Presentation name |
protected DOMTreeTableAdapter |
_tableModel
|
static int |
DELETE
|
static int |
INSERT
|
static int |
MOVE
|
Fields inherited from interface org.merlotxml.merlot.MerlotConstants |
ACTION_MENU_ACCELERATOR, ACTION_MENU_ICON, ACTION_NAME, ACTION_SHORT_DESCRIPTION, ACTION_SMALL_ICON, AFTER, BEFORE, ERR, INTO, UI, XML |
Constructor Summary | |
MerlotUndoableEdit(java.lang.String pname,
int action,
DOMTreeTableAdapter model,
MerlotDOMNode nd,
int[] where)
|
Method Summary | |
boolean |
addEdit(javax.swing.undo.UndoableEdit anEdit)
This UndoableEdit should absorb anEdit if it can. |
java.lang.String |
array2String(int[] array)
|
boolean |
canRedo()
True if it is still possible to redo this operation |
boolean |
canUndo()
True if it is still possible to undo this operation |
void |
die()
May be sent to inform an edit that it should no longer be used. |
protected MerlotDOMNode |
getParentFromLocationPath()
This gets the parent node from the location path |
java.lang.String |
getPresentationName()
Provide a localized, human readable description of this edit suitable for use in, say, a change log. |
java.lang.String |
getRedoPresentationName()
Provide a localized, human readable description of the redoable form of this edit, e.g. |
java.lang.String |
getUndoPresentationName()
Provide a localized, human readable description of the undoable form of this edit, e.g. |
boolean |
isSignificant()
Return false if this edit is insignificant--for example one that maintains the user's selection, but does not change any model state. |
void |
redo()
Re-apply the edit, assuming that it has been undone. |
boolean |
replaceEdit(javax.swing.undo.UndoableEdit anEdit)
Return true if this UndoableEdit should replace anEdit. |
void |
setPresentationName(java.lang.String s)
|
java.lang.String |
toString()
|
void |
undo()
Undo the edit that was made. |
protected void |
undoDelete()
|
protected void |
undoInsert()
|
protected void |
undoMove()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int DELETE
public static final int INSERT
public static final int MOVE
protected MerlotDOMNode _node
protected int[] _nodeLocation
protected DOMTreeTableAdapter _tableModel
protected java.lang.String _presName
protected int _action
Constructor Detail |
public MerlotUndoableEdit(java.lang.String pname, int action, DOMTreeTableAdapter model, MerlotDOMNode nd, int[] where)
Method Detail |
public void undo() throws javax.swing.undo.CannotUndoException
undo
in interface javax.swing.undo.UndoableEdit
javax.swing.undo.CannotUndoException
protected void undoDelete() throws javax.swing.undo.CannotUndoException
javax.swing.undo.CannotUndoException
protected void undoInsert() throws javax.swing.undo.CannotUndoException
javax.swing.undo.CannotUndoException
protected void undoMove() throws javax.swing.undo.CannotUndoException
javax.swing.undo.CannotUndoException
protected MerlotDOMNode getParentFromLocationPath() throws javax.swing.undo.CannotUndoException
javax.swing.undo.CannotUndoException
public boolean canUndo()
canUndo
in interface javax.swing.undo.UndoableEdit
public void redo() throws javax.swing.undo.CannotRedoException
redo
in interface javax.swing.undo.UndoableEdit
javax.swing.undo.CannotRedoException
public boolean canRedo()
canRedo
in interface javax.swing.undo.UndoableEdit
public void die()
die
in interface javax.swing.undo.UndoableEdit
CompoundEdit#die
public boolean addEdit(javax.swing.undo.UndoableEdit anEdit)
Typically the receiver is already in the queue of a UndoManager (or other UndoableEditListener), and is being given a chance to incorporate anEdit rather than letting it be added to the queue in turn.
If true is returned, from now on anEdit must return false from canUndo() and canRedo(), and must throw the appropriate exception on undo() or redo().
addEdit
in interface javax.swing.undo.UndoableEdit
public boolean replaceEdit(javax.swing.undo.UndoableEdit anEdit)
This message is the opposite of addEdit--anEdit has typically already been queued in a UndoManager (or other UndoableEditListener), and the receiver is being given a chance to take its place.
If true is returned, from now on anEdit must return false from canUndo() and canRedo(), and must throw the appropriate exception on undo() or redo().
replaceEdit
in interface javax.swing.undo.UndoableEdit
public boolean isSignificant()
isSignificant
in interface javax.swing.undo.UndoableEdit
public java.lang.String getPresentationName()
getPresentationName
in interface javax.swing.undo.UndoableEdit
public void setPresentationName(java.lang.String s)
public java.lang.String getUndoPresentationName()
getUndoPresentationName
in interface javax.swing.undo.UndoableEdit
public java.lang.String getRedoPresentationName()
getRedoPresentationName
in interface javax.swing.undo.UndoableEdit
public java.lang.String toString()
public java.lang.String array2String(int[] array)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |