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() . |
getDataContainer
addEdit, canRedo, canUndo, die, getPresentationName, getRedoPresentationName, getUndoPresentationName, isSignificant, replaceEdit, toString
public 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 UndoableEdit
undo
in class AbstractUndoableEdit
CannotUndoException
AbstractUndoableEdit.canUndo()
public void redo() throws CannotRedoException
redo
in interface UndoableEdit
redo
in class AbstractUndoableEdit
CannotRedoException
AbstractUndoableEdit.canRedo()
,
getParentNode()
© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.