|
UndoRedo V1.2 by Matthew Ford 2005/06/27 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectau.com.forward.undoRedo.UndoRedo
public class UndoRedo
Wrapps an UndoableEdit for adding to the UndoRedoManager tree.
Wrapping allows us to reuse the original UndoableEdit when
adding Undo nodes generated from redo branches. This avoids
the need to clone the original UndoableEdit, which may not be cloneable
or may require significant memory.
Field Summary | |
---|---|
static java.lang.String |
ALL_REDONE_PREFIX
Prefix for all nodes redone. |
static java.lang.String |
DEAD_FORMAT
Prefix for dead nodes |
protected javax.swing.undo.UndoableEdit |
edit
the wrapped edit |
static java.lang.String |
HTML_START
Prefix for HTML |
static java.lang.String |
INSIGNIFICANT_FORMAT
Prefix for insignificant nodes |
static java.lang.String |
REDONE_PREFIX
Prefix for redone nodes |
static java.lang.String |
UNREACHABLE_FORMAT
Prefix for unreachable nodes |
Constructor Summary | |
---|---|
UndoRedo(javax.swing.undo.UndoableEdit edit)
Creates a new instance of UndoRedo wrapping an UndoableEdit. |
Method Summary | |
---|---|
boolean |
addEdit(javax.swing.undo.UndoableEdit anEdit)
Does nothing, always returns false. |
boolean |
canRedo()
True if it is still possible to redo this operation. |
boolean |
canUndo()
True if it is still possible to undo this operation. |
java.lang.Object |
clone()
Returns the clone of this UndoRedo. |
void |
die()
May be sent to inform an edit that it should no longer be used. |
boolean |
equalsComplement(java.lang.Object obj)
Returns true if the obj is the complement of this UndoRedo. |
static java.lang.String |
escapeHTML(java.lang.String input)
|
UndoRedo |
getComplement()
Returns the UndoRedo complement of this object. |
java.lang.String |
getPresentationName()
Provides a localized, human readable description of this edit , should be detailed enough to provide a the basis of a meaningful node lable. |
java.lang.String |
getRedoPresentationName()
Provides a localized, human readable description of the redoable form of this edit. |
javax.swing.undo.UndoableEdit |
getUndoableEdit()
Returns the UndoableEdit wrapped by this UndoRedo |
java.lang.String |
getUndoPresentationName()
Provides a localized, human readable description of the undoable form of this edit. |
boolean |
isDead()
Is the wrapped UndoableEdit dead |
boolean |
isSignificant()
Returns false if this edit is insignificant--for example one that maintains the user's selection, but does not change any model state. |
boolean |
isUndo()
Returns true if this is the undo version. |
boolean |
isUnreachable()
Returns true if thie undo/redo cannot be reached. |
void |
redo()
Re-apply the edit, assuming that it has been undone. |
boolean |
replaceEdit(javax.swing.undo.UndoableEdit anEdit)
Does nothing, always returns false. |
void |
setUnreachable()
Sets this undo/redo as being un-reached. |
java.lang.String |
toString()
Returns a string representation of this UndoRedo object. |
void |
undo()
Undo the edit that was made. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected javax.swing.undo.UndoableEdit edit
public static java.lang.String HTML_START
public static java.lang.String REDONE_PREFIX
public static java.lang.String ALL_REDONE_PREFIX
public static java.lang.String DEAD_FORMAT
public static java.lang.String UNREACHABLE_FORMAT
public static java.lang.String INSIGNIFICANT_FORMAT
Constructor Detail |
---|
public UndoRedo(javax.swing.undo.UndoableEdit edit)
Method Detail |
---|
public javax.swing.undo.UndoableEdit getUndoableEdit()
public boolean equalsComplement(java.lang.Object obj)
obj
- the object to test
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
public boolean isUndo()
public boolean isUnreachable()
public void setUnreachable()
public UndoRedo getComplement()
public void undo() throws javax.swing.undo.CannotUndoException
undo
in interface javax.swing.undo.UndoableEdit
javax.swing.undo.CannotUndoException
- if cannot be undone.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
- if cannot be redone.public boolean canRedo()
canRedo
in interface javax.swing.undo.UndoableEdit
public boolean isDead()
public void die()
die
in interface javax.swing.undo.UndoableEdit
public boolean addEdit(javax.swing.undo.UndoableEdit anEdit)
addEdit
in interface javax.swing.undo.UndoableEdit
anEdit
- the edit to be added
public boolean replaceEdit(javax.swing.undo.UndoableEdit anEdit)
replaceEdit
in interface javax.swing.undo.UndoableEdit
anEdit
- the edit to be replace this edit
public boolean isSignificant()
UndoableEditListener
(like UndoManager) when deciding which UndoableEdits to present
to the user as Undo/Redo options, and which to perform as side
effects of undoing or redoing other events.
UndoRedoManager does not take any notice of this hint.
isSignificant
in interface javax.swing.undo.UndoableEdit
public java.lang.String getPresentationName()
getPresentationName
in interface javax.swing.undo.UndoableEdit
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()
toString
in class java.lang.Object
public static java.lang.String escapeHTML(java.lang.String input)
|
©2005, Forward Computing and Control Pty. Ltd ACN 003 669 994 NSW Australia All Rights Reserved. |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |