|
CubeTwister 2.0alpha142 2012-02-11 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjavax.swing.undo.AbstractUndoableEdit
ch.randelshofer.undo.UndoableBooleanEdit
public abstract class UndoableBooleanEdit
This is an abstract class for undoable int properties. If the property is changed multiple times in sequence, then these edit events are coalesced.
| Field Summary | |
|---|---|
protected boolean |
newValue
|
protected boolean |
oldValue
|
protected java.lang.String |
propertyName
|
protected java.lang.Object |
source
|
| Fields inherited from class javax.swing.undo.AbstractUndoableEdit |
|---|
RedoName, UndoName |
| Constructor Summary | |
|---|---|
UndoableBooleanEdit(java.lang.Object source,
java.lang.String propertyName,
boolean oldValue,
boolean newValue)
Creates new UndoableBooleanEdit |
|
UndoableBooleanEdit(java.lang.Object source,
java.lang.String propertyName,
boolean oldValue,
boolean newValue,
boolean isSignificant)
Creates new UndoableBooleanEdit |
|
| Method Summary | |
|---|---|
boolean |
addEdit(javax.swing.undo.UndoableEdit anEdit)
This UndoableEdit should absorb anEdit if it can. |
java.lang.String |
getPresentationName()
The name to be displayed in the undo/redo menu. |
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. |
void |
redo()
Re-apply the edit, assuming that it has been undone. |
abstract void |
revert(boolean oldValue,
boolean newValue)
Revert the property from the oldValue to the newValue. |
void |
undo()
Undo the edit that was made. |
| Methods inherited from class javax.swing.undo.AbstractUndoableEdit |
|---|
canRedo, canUndo, die, getRedoPresentationName, getUndoPresentationName, replaceEdit, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected java.lang.Object source
protected java.lang.String propertyName
protected boolean oldValue
protected boolean newValue
| Constructor Detail |
|---|
public UndoableBooleanEdit(java.lang.Object source,
java.lang.String propertyName,
boolean oldValue,
boolean newValue)
source - The Object to which the property belongs.propertyName - The name of the property.oldValue - The old value of the property.newValue - The new value of the property.
public UndoableBooleanEdit(java.lang.Object source,
java.lang.String propertyName,
boolean oldValue,
boolean newValue,
boolean isSignificant)
source - The Object to which the property belongs.propertyName - The name of the property.oldValue - The old value of the property.newValue - The new value of the property.isSignificant - The significance of the edit event.| Method Detail |
|---|
public void redo()
redo in interface javax.swing.undo.UndoableEditredo in class javax.swing.undo.AbstractUndoableEditpublic void undo()
undo in interface javax.swing.undo.UndoableEditundo in class javax.swing.undo.AbstractUndoableEditpublic java.lang.String getPresentationName()
getPresentationName in interface javax.swing.undo.UndoableEditgetPresentationName in class javax.swing.undo.AbstractUndoableEditpublic 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.UndoableEditaddEdit in class javax.swing.undo.AbstractUndoableEdit
public abstract void revert(boolean oldValue,
boolean newValue)
public boolean isSignificant()
isSignificant in interface javax.swing.undo.UndoableEditisSignificant in class javax.swing.undo.AbstractUndoableEdit
|
(c) Werner Randelshofer. All rights reserved. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||