public class DefaultNodeDragAndDropCommand extends AbstractCommand
DefaultTreeTableModel
and the old parent node, the new
parent node, and the dragged node are all implementors of the
IMutableTreeTableNode
interface.INodeDragAndDropPolicy.getDragAndDropCommand(Object, Object,
com.dlsc.flexgantt.model.treetable.ITreeTableModel, int, Object,
com.dlsc.flexgantt.model.treetable.ITreeTableModel, int, int)
,
Serialized FormConstructor and Description |
---|
DefaultNodeDragAndDropCommand(IMutableTreeTableNode draggedNode,
IMutableTreeTableNode oldParentNode,
DefaultTreeTableModel oldModel,
int oldChildIndex,
IMutableTreeTableNode newParentNode,
DefaultTreeTableModel newModel,
int newChildIndex,
int dropAction)
Constructs a new command.
|
Modifier and Type | Method and Description |
---|---|
void |
executeCommand(IProgressMonitor monitor)
Executes the command.
|
IMutableTreeTableNode |
getDraggedNode()
Returns the dragged node.
|
int |
getDropAction()
Returns the user drop action that was used when the command was
triggered.
|
int |
getNewChildIndex()
Returns the index of the dragged node within the list of children of the
new parent node.
|
DefaultTreeTableModel |
getNewModel()
Returns the model to which the dragged node belongs after the command
gets executed.
|
IMutableTreeTableNode |
getNewParent()
Returns the parent node to which the dragged node was / will be assigned
by the command.
|
int |
getOldChildIndex()
Returns the index of the dragged node within the list of children of the
old parent node.
|
DefaultTreeTableModel |
getOldModel()
Returns the model to which the dragged node belongs before the command
gets executed.
|
IMutableTreeTableNode |
getOldParent()
Returns the old parent node to which the dragged node belonged before the
command was executed.
|
void |
undoCommand(IProgressMonitor monitor)
Undos the command.
|
getName, isRedoable, isRelevant, isUndoable, redoCommand, setName
public DefaultNodeDragAndDropCommand(IMutableTreeTableNode draggedNode, IMutableTreeTableNode oldParentNode, DefaultTreeTableModel oldModel, int oldChildIndex, IMutableTreeTableNode newParentNode, DefaultTreeTableModel newModel, int newChildIndex, int dropAction)
draggedNode
- the tree table node that gets dragged and droppedoldParentNode
- the old parent node of the dragged nodeoldModel
- the old model to which the old parent and the dragged node
belongoldChildIndex
- the old index of the dragged node within the list of children
of the old parent nodenewParentNode
- the new parent node to which the dragged node will be assignednewModel
- the new model to which the new parent and the dragged node
will belongnewChildIndex
- the new index of the dragged node within the list of children
of the new parent nodedropAction
- the type of drop performed (possible values are listed in
DnDConstants
)public void executeCommand(IProgressMonitor monitor) throws CommandException
ICommand
monitor
- a progress monitorCommandException
- if anything during the execution of the command has gone
wrongpublic void undoCommand(IProgressMonitor monitor) throws CommandException
ICommand
monitor
- a progress monitorCommandException
- if anything during the execution of the command has gone
wrongpublic IMutableTreeTableNode getDraggedNode()
public IMutableTreeTableNode getNewParent()
public IMutableTreeTableNode getOldParent()
public int getNewChildIndex()
public int getOldChildIndex()
public DefaultTreeTableModel getOldModel()
public DefaultTreeTableModel getNewModel()
public int getDropAction()
DnDConstants
.DnDConstants.ACTION_MOVE
or
DnDConstants.ACTION_COPY
).INodeDragAndDropPolicy.getDropActions(Object, Object,
com.dlsc.flexgantt.model.treetable.ITreeTableModel, Object,
com.dlsc.flexgantt.model.treetable.ITreeTableModel)
,
INodeDragAndDropPolicy.getDragAndDropCommand(Object, Object,
com.dlsc.flexgantt.model.treetable.ITreeTableModel, int, Object,
com.dlsc.flexgantt.model.treetable.ITreeTableModel, int, int)
Copyright © 2006–2020 Dirk Lemmermann Software & Consulting. All rights reserved.