public class IlvAddNodeEdit extends IlvAbstractDataContainerUndoableEdit
IlvAbstractDataContainerUndoableEdit
for
adding a node object to a data container.RedoName, UndoName
Constructor and Description |
---|
IlvAddNodeEdit(IlvDataContainer dataContainer,
Object parent,
Object node,
int index)
Creates an edit that adds a node to the specified data container.
|
Modifier and Type | Method and Description |
---|---|
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.
|
getDataContainer
addEdit, canRedo, canUndo, die, getPresentationName, getRedoPresentationName, getUndoPresentationName, isSignificant, replaceEdit, toString
public IlvAddNodeEdit(IlvDataContainer dataContainer, Object parent, Object node, int index)
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 addindex
- 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.public Object getParentNode()
public Object getNode()
public int getIndex()
public void undo() throws CannotUndoException
undo
in interface UndoableEdit
undo
in class AbstractUndoableEdit
CannotUndoException
AbstractUndoableEdit.canUndo()
,
redo()
public void redo() throws CannotRedoException
getNode()
to the parent node given
by the method getParentNode()
.redo
in interface UndoableEdit
redo
in class AbstractUndoableEdit
CannotRedoException
AbstractUndoableEdit.canRedo()
© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.