ilog.views.appframe.docview.project
Class IlvNodePropertyChangeEdit

java.lang.Object
  extended by javax.swing.undo.AbstractUndoableEdit
      extended by ilog.views.appframe.docview.project.IlvAbstractDataContainerUndoableEdit
          extended by ilog.views.appframe.docview.project.IlvNodePropertyChangeEdit
All Implemented Interfaces:
Serializable, UndoableEdit

public class IlvNodePropertyChangeEdit
extends IlvAbstractDataContainerUndoableEdit

A concrete subclass of IlvAbstractDataContainerUndoableEdit for changing the property of a node of a data container.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.undo.AbstractUndoableEdit
RedoName, UndoName
 
Constructor Summary
IlvNodePropertyChangeEdit(IlvDataContainer dataContainer, Object parent, Object node, int index, String propertyName, Object oldValue, Object newValue)
          Creates an edit that changes a property of a node of a data container.
 
Method Summary
 int getIndex()
          Returns the index of the node in the child array of its parent.
 Object getNewValue()
          Returns the new value of the property.
 Object getNode()
          Returns the node to change the property of.
 Object getOldValue()
          Returns the value of the property before it was changed.
 Object getParentNode()
          Returns the parent of the node to change the property of.
 String getPropertyName()
          Returns the name of the property to change the value of.
 void redo()
          Sets the property of the node with the name given by getPropertyName() to the value given by getNewValue().
 void undo()
          Sets the property of the node with the name given by getPropertyName() to the value given by getOldValue().
 
Methods inherited from class ilog.views.appframe.docview.project.IlvAbstractDataContainerUndoableEdit
getDataContainer
 
Methods inherited from class javax.swing.undo.AbstractUndoableEdit
addEdit, canRedo, canUndo, die, getPresentationName, getRedoPresentationName, getUndoPresentationName, isSignificant, replaceEdit, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IlvNodePropertyChangeEdit

public IlvNodePropertyChangeEdit(IlvDataContainer dataContainer,
                                 Object parent,
                                 Object node,
                                 int index,
                                 String propertyName,
                                 Object oldValue,
                                 Object newValue)
Creates an edit that changes a property of a node of a data container.

Parameters:
dataContainer - The data container that contains the node to change a property of.
parent - The parent of the node to change a property of - can be null.
node - The node to change the property of.
index - The index of the node in the child array of the parent node.
propertyName - The name of the property to change.
oldValue - The value of the property before it was changed.
newValue - The new value of the property.
Method Detail

getParentNode

public Object getParentNode()
Returns the parent of the node to change the property of.


getNode

public Object getNode()
Returns the node to change the property of.


getIndex

public int getIndex()
Returns the index of the node in the child array of its parent.


getPropertyName

public String getPropertyName()
Returns the name of the property to change the value of.


getOldValue

public Object getOldValue()
Returns the value of the property before it was changed.

See Also:
getNewValue(), getPropertyName()

getNewValue

public Object getNewValue()
Returns the new value of the property.

See Also:
getOldValue(), getPropertyName()

undo

public void undo()
          throws CannotUndoException
Sets the property of the node with the name given by getPropertyName() to the value given by getOldValue().

Specified by:
undo in interface UndoableEdit
Overrides:
undo in class AbstractUndoableEdit
Throws:
CannotUndoException
See Also:
AbstractUndoableEdit.canUndo()

redo

public void redo()
          throws CannotRedoException
Sets the property of the node with the name given by getPropertyName() to the value given by getNewValue().

Specified by:
redo in interface UndoableEdit
Overrides:
redo in class AbstractUndoableEdit
Throws:
CannotRedoException
See Also:
AbstractUndoableEdit.canRedo()


Copyright © 1996-2007 ILOG S.A. All rights reserved.   Documentation homepage.   . All Rights Reserved.