public class IlvRemoveNodeEdit extends IlvAbstractDataContainerUndoableEdit
IlvAbstractDataContainerUndoableEdit to
remove a node from a data container.RedoName, UndoName| Constructor and Description |
|---|
IlvRemoveNodeEdit(IlvDataContainer dataContainer,
Object parent,
Object node)
Creates an edit that removes a node from the specified data container.
|
| Modifier and Type | Method and Description |
|---|---|
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(). |
getDataContaineraddEdit, canRedo, canUndo, die, getPresentationName, getRedoPresentationName, getUndoPresentationName, isSignificant, replaceEdit, toStringpublic IlvRemoveNodeEdit(IlvDataContainer dataContainer, Object parent, Object node)
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.public Object getParentNode()
public Object getNode()
public int getIndex()
getParentNode()public void undo()
throws CannotUndoException
getParentNode() at the insertion index given
by getIndex().undo in interface UndoableEditundo in class AbstractUndoableEditCannotUndoExceptionAbstractUndoableEdit.canUndo()public void redo()
throws CannotRedoException
redo in interface UndoableEditredo in class AbstractUndoableEditCannotRedoExceptionAbstractUndoableEdit.canRedo(),
getParentNode()© Copyright Rogue Wave Software, Inc. 1997, 2017. All Rights Reserved.