ilog.views.appframe.docview.project
Class IlvRemoveNodeEdit

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

public class IlvRemoveNodeEdit
extends IlvAbstractDataContainerUndoableEdit

A concrete subclass of IlvAbstractDataContainerUndoableEdit to remove a node from a data container.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.undo.AbstractUndoableEdit
RedoName, UndoName
 
Constructor Summary
IlvRemoveNodeEdit(IlvDataContainer dataContainer, Object parent, Object node)
          Creates an edit that removes a node from the specified data container.
 
Method Summary
 int getIndex()
          Returns the index where the node that this edit removes was inserted in the child array of the parent of the node.
 Object getNode()
          Returns the node that this edit removes.
 Object getParentNode()
          Returns the parent node that this edit removes a child node from.
 void redo()
          Removes the node associated with this edit from its parent.
 void undo()
          Adds the node removed by this edit to the previous parent of the node given by the method getParentNode() at the insertion index given by getIndex().
 
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

IlvRemoveNodeEdit

public IlvRemoveNodeEdit(IlvDataContainer dataContainer,
                         Object parent,
                         Object node)
Creates an edit that removes a node from the specified data container.

Parameters:
dataContainer - The data container to remove a node from.
parent - The parent node to remove a child node from or null.
node - The node to remove.
Method Detail

getParentNode

public Object getParentNode()
Returns the parent node that this edit removes a child node from.


getNode

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


getIndex

public int getIndex()
Returns the index where the node that this edit removes was inserted in the child array of the parent of the node.

See Also:
getParentNode()

undo

public void undo()
          throws CannotUndoException
Adds the node removed by this edit to the previous parent of the node given by the method getParentNode() at the insertion index given by getIndex().

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

redo

public void redo()
          throws CannotRedoException
Removes the node associated with this edit from its parent.

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


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