ca.sqlpower.architect.undo
Class PropertyChangeEdit

java.lang.Object
  extended by javax.swing.undo.AbstractUndoableEdit
      extended by ca.sqlpower.architect.undo.PropertyChangeEdit
All Implemented Interfaces:
java.io.Serializable, javax.swing.undo.UndoableEdit

public class PropertyChangeEdit
extends javax.swing.undo.AbstractUndoableEdit

This is the generic edit class that dynamically modifies bean properties according to the PropertyChangeEvent source and the property name.

Author:
kaiyi
See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.undo.AbstractUndoableEdit
RedoName, UndoName
 
Constructor Summary
PropertyChangeEdit(java.beans.PropertyChangeEvent e)
           
 
Method Summary
 java.lang.Object getNewValue()
          Returns the property's new value.
 java.lang.Object getOldValue()
          Returns the property's old value.
 java.lang.String getPresentationName()
           
 java.lang.String getPropertyName()
          Returns the name of the property that this edit represents a change to.
 java.lang.Object getSource()
          Returns the object whose property changed.
 void redo()
          Sets the value of the property to be the new value
 java.lang.String toString()
           
 void undo()
          Sets the value of the property to be the old value
 
Methods inherited from class javax.swing.undo.AbstractUndoableEdit
addEdit, canRedo, canUndo, die, getRedoPresentationName, getUndoPresentationName, isSignificant, replaceEdit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PropertyChangeEdit

public PropertyChangeEdit(java.beans.PropertyChangeEvent e)
Method Detail

undo

public void undo()
          throws javax.swing.undo.CannotUndoException
Sets the value of the property to be the old value

Specified by:
undo in interface javax.swing.undo.UndoableEdit
Overrides:
undo in class javax.swing.undo.AbstractUndoableEdit
Throws:
javax.swing.undo.CannotUndoException

redo

public void redo()
          throws javax.swing.undo.CannotRedoException
Sets the value of the property to be the new value

Specified by:
redo in interface javax.swing.undo.UndoableEdit
Overrides:
redo in class javax.swing.undo.AbstractUndoableEdit
Throws:
javax.swing.undo.CannotRedoException

getPresentationName

public java.lang.String getPresentationName()
Specified by:
getPresentationName in interface javax.swing.undo.UndoableEdit
Overrides:
getPresentationName in class javax.swing.undo.AbstractUndoableEdit

getPropertyName

public java.lang.String getPropertyName()
Returns the name of the property that this edit represents a change to.


getNewValue

public java.lang.Object getNewValue()
Returns the property's new value. This is the value that this edit will redo to.


getOldValue

public java.lang.Object getOldValue()
Returns the property's old value. This is the value that this edit will undo to.


getSource

public java.lang.Object getSource()
Returns the object whose property changed.

Returns:

toString

public java.lang.String toString()
Overrides:
toString in class javax.swing.undo.AbstractUndoableEdit


Copyright © 2003-2007 SQL Power Group Inc. www.sqlpower.ca