public class TreeTableDragAndDropManager extends Object implements DragSourceListener, DropTargetListener, DragGestureListener, ICommandStackListener, PropertyChangeListener
INodeDragAndDropPolicy.getDragActions(Object, ITreeTableModel),
INodeDragAndDropPolicy.getDropActions(Object, Object, ITreeTableModel,
Object, ITreeTableModel),
INodeDragAndDropPolicy.getDragAndDropCommand(Object, Object,
ITreeTableModel, int, Object, ITreeTableModel, int, int),
ITreeTableNode.getDragActions(),
ITreeTableNode.getDropActions(ITreeTableNode)| Constructor and Description |
|---|
TreeTableDragAndDropManager(TreeTable table)
Constructs a new drag and drop manager for the given table.
|
| Modifier and Type | Method and Description |
|---|---|
void |
commandStackChanged(CommandStackEvent e)
Gets called whenever the command stack changed.
|
protected Image |
createDragImage(TreeTableNode node)
Creates a drag image for the given tree table node.
|
void |
dragDropEnd(DragSourceDropEvent e) |
void |
dragEnter(DragSourceDragEvent e) |
void |
dragEnter(DropTargetDragEvent dtde) |
void |
dragExit(DragSourceEvent dse) |
void |
dragExit(DropTargetEvent dte) |
void |
dragGestureRecognized(DragGestureEvent dge) |
void |
dragOver(DragSourceDragEvent dsde) |
void |
dragOver(DropTargetDragEvent dtde) |
void |
drop(DropTargetDropEvent dtde) |
void |
dropActionChanged(DragSourceDragEvent dsde) |
void |
dropActionChanged(DropTargetDragEvent dtde) |
TreeTableNode |
getDraggedNode()
Returns the dragged tree table node.
|
Point |
getDragLocation()
Returns the current drag location.
|
int |
getDropRow()
Returns the row where the drop will occure when the user finishes the
drop.
|
TreeTable |
getTreeTable()
Returns the tree table that is being managed by the DnD manager.
|
boolean |
isDragOK(DropTargetDragEvent dtde)
Performs all the necessary checks in order to find out whether the given
drop target event specifies a valid drop location.
|
boolean |
isValidDropLocation()
Determines whether the current drag location is a valid drop location.
|
void |
propertyChange(PropertyChangeEvent evt) |
public TreeTableDragAndDropManager(TreeTable table)
table - the table that will be managedpublic TreeTable getTreeTable()
public void dragEnter(DragSourceDragEvent e)
dragEnter in interface DragSourceListenerpublic void dragOver(DragSourceDragEvent dsde)
dragOver in interface DragSourceListenerpublic void dropActionChanged(DragSourceDragEvent dsde)
dropActionChanged in interface DragSourceListenerpublic void dragExit(DragSourceEvent dse)
dragExit in interface DragSourceListenerpublic void dragDropEnd(DragSourceDropEvent e)
dragDropEnd in interface DragSourceListenerpublic void dragEnter(DropTargetDragEvent dtde)
dragEnter in interface DropTargetListenerpublic void dragOver(DropTargetDragEvent dtde)
dragOver in interface DropTargetListenerpublic void dropActionChanged(DropTargetDragEvent dtde)
dropActionChanged in interface DropTargetListenerpublic void dragExit(DropTargetEvent dte)
dragExit in interface DropTargetListenerpublic void drop(DropTargetDropEvent dtde)
drop in interface DropTargetListenerpublic void dragGestureRecognized(DragGestureEvent dge)
dragGestureRecognized in interface DragGestureListenerpublic int getDropRow()
public TreeTableNode getDraggedNode()
public Point getDragLocation()
protected Image createDragImage(TreeTableNode node)
Integer.MIN_VALUE for the column index so that the renderer knows
that it is rendering the drag image.node - the node that is being draggedDragSource.isDragImageSupported()public void commandStackChanged(CommandStackEvent e)
ICommandStackListenercommandStackChanged in interface ICommandStackListenere - the event issued by the command stackpublic void propertyChange(PropertyChangeEvent evt)
propertyChange in interface PropertyChangeListenerpublic boolean isDragOK(DropTargetDragEvent dtde)
dtde - the drop target drag eventpublic boolean isValidDropLocation()
Copyright © 2006–2020 Dirk Lemmermann Software & Consulting. All rights reserved.