ilog.views.appframe.docview.project
Class IlvAddNodeEdit

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

public class IlvAddNodeEdit
extends IlvAbstractDataContainerUndoableEdit

A concrete subclass of IlvAbstractDataContainerUndoableEdit for adding a node object to a data container.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.undo.AbstractUndoableEdit
RedoName, UndoName
 
Constructor Summary
IlvAddNodeEdit(IlvDataContainer dataContainer, Object parent, Object node, int index)
          Creates an edit that adds a node to the specified data container.
 
Method Summary
 int getIndex()
          Returns the insertion index.
 Object getNode()
          Returns the node that this edit adds.
 Object getParentNode()
          Returns the parent node this edit adds a node to.
 void redo()
          Adds the node given by the method getNode() to the parent node given by the method getParentNode().
 void undo()
          Removes the node added by this edit.
 
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

IlvAddNodeEdit

public IlvAddNodeEdit(IlvDataContainer dataContainer,
                      Object parent,
                      Object node,
                      int index)
Creates an edit that adds a node to the specified data container.

Parameters:
dataContainer - The data container to add a node to.
parent - The parent node to add a node to - can be null.
node - The node to add
index - The insertion index of the node in the child array of the parent node. If equal to -1, the node will be added at the last position in the array.
Method Detail

getParentNode

public Object getParentNode()
Returns the parent node this edit adds a node to.


getNode

public Object getNode()
Returns the node that this edit adds.


getIndex

public int getIndex()
Returns the insertion index.


undo

public void undo()
          throws CannotUndoException
Removes the node added by this edit.

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

redo

public void redo()
          throws CannotRedoException
Adds the node given by the method getNode() to the parent node given by the method getParentNode().

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.