|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.undo.AbstractUndoableEdit
dsto.dfc.swing.undo.AbstractMonitoredEdit
dsto.dfc.swing.undo.PropertyEdit
public class PropertyEdit
Used to undo property changes.
Field Summary | |
---|---|
Object |
newValue
The new value of the property. |
Object |
oldValue
The old value of the property. |
String |
propertyName
The name of the changed property. |
Object |
source
The source of the property change. |
Fields inherited from class dsto.dfc.swing.undo.AbstractMonitoredEdit |
---|
alive, ICON, parameterNames, parameterValues |
Fields inherited from class javax.swing.undo.AbstractUndoableEdit |
---|
RedoName, UndoName |
Fields inherited from interface dsto.dfc.swing.icons.Iconic |
---|
NULL_ICON |
Constructor Summary | |
---|---|
PropertyEdit()
For bean serialisation only |
|
PropertyEdit(Object source,
String propertyName,
Object oldValue,
Object newValue)
Constructs a PropertyEdit with the supplied information. |
|
PropertyEdit(PropertyChangeEvent event)
Constructs a PropertyEdit from the PropertyChangeEvent . |
Method Summary | |
---|---|
String |
getDescription()
Returns a description of this type of UndoableEdit . |
String |
getPresentationName()
Returns a presentation name of the form: |
String |
getPropertyName()
|
String |
getRedoPresentationName()
|
String |
getUndoPresentationName()
|
void |
redo()
Sets the source 's propertyName value to newValue. |
void |
setPropertyName(String propertyName)
|
protected void |
setPropertyValue(Object value,
RuntimeException undoRedoException)
Attempts to set the propertyName property of source to
value and throws undoRedoException if it does not succeed. |
void |
undo()
Sets the source 's propertyName value to oldValue. |
protected void |
writeSource(ObjectOutputStream out)
Override this method if your source is not serialisable. |
protected void |
writeValue(Object value,
ObjectOutputStream out)
Override with value specific code if value is not serialisable. |
Methods inherited from class dsto.dfc.swing.undo.AbstractMonitoredEdit |
---|
canRedo, canUndo, clone, die, getIcon, getLargeIcon, getName, getParameterNames, getParameterValues, restoreContext, setParameterNames, setParameterValues |
Methods inherited from class javax.swing.undo.AbstractUndoableEdit |
---|
addEdit, isSignificant, replaceEdit, toString |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface javax.swing.undo.UndoableEdit |
---|
addEdit, isSignificant, replaceEdit |
Field Detail |
---|
public transient Object source
public String propertyName
public transient Object oldValue
public transient Object newValue
Constructor Detail |
---|
public PropertyEdit()
public PropertyEdit(Object source, String propertyName, Object oldValue, Object newValue)
PropertyEdit
with the supplied information.
public PropertyEdit(PropertyChangeEvent event)
PropertyEdit
from the PropertyChangeEvent
.
Method Detail |
---|
public String getPropertyName()
public void setPropertyName(String propertyName)
public String getDescription()
UndoableEdit
.
getDescription
in interface MonitoredEdit
getDescription
in class AbstractMonitoredEdit
protected void setPropertyValue(Object value, RuntimeException undoRedoException)
propertyName
property of source
to
value and throws undoRedoException if it does not succeed.
Used by undo()
and redo()
.
public void undo() throws CannotUndoException
source
's propertyName value to oldValue.
undo
in interface UndoableEdit
undo
in class AbstractMonitoredEdit
CannotUndoException
public void redo() throws CannotRedoException
source
's propertyName value to newValue.
redo
in interface UndoableEdit
redo
in class AbstractMonitoredEdit
CannotRedoException
public String getPresentationName()
"If thesource
" change "propertyName
[oldValue
} ->newValue
]@quot;
Object.toString()
methods of the source
,
oldValue
, or newValue
are memory references, then their
class name is displayed instead for readability purposes.
getPresentationName
in interface UndoableEdit
getPresentationName
in class AbstractUndoableEdit
public String getUndoPresentationName()
getUndoPresentationName
in interface UndoableEdit
getUndoPresentationName
in class AbstractMonitoredEdit
public String getRedoPresentationName()
getRedoPresentationName
in interface UndoableEdit
getRedoPresentationName
in class AbstractMonitoredEdit
protected void writeSource(ObjectOutputStream out) throws IOException
source
is not serialisable. Make sure
that only one Object
is written to the out stream,
however.
IOException
protected void writeValue(Object value, ObjectOutputStream out) throws IOException
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |