|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.dlsc.flexgantt.command.AbstractCommand com.dlsc.flexgantt.command.treetable.DefaultNodeDragAndDropCommand
public class DefaultNodeDragAndDropCommand
A command that performs the necessary changes after a drag and drop event
within the tree table. The command will reassign the dragged node to a new
parent node after removing it from the current parent node. This command will
only work in situations where the source and the target tree table model are
instances of 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 Summary | |
---|---|
DefaultNodeDragAndDropCommand(IMutableTreeTableNode draggedNode,
IMutableTreeTableNode oldParentNode,
DefaultTreeTableModel oldModel,
int oldChildIndex,
IMutableTreeTableNode newParentNode,
DefaultTreeTableModel newModel,
int newChildIndex,
int dropAction)
Constructs a new command. |
Method Summary | |
---|---|
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. |
Methods inherited from class com.dlsc.flexgantt.command.AbstractCommand |
---|
getName, isRedoable, isRelevant, isUndoable, redoCommand |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
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
)Method Detail |
---|
public void executeCommand(IProgressMonitor monitor)
ICommand
monitor
- a progress monitorpublic void undoCommand(IProgressMonitor monitor)
ICommand
monitor
- a progress monitorpublic 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)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |