Drag and Drop [message #134420] |
Tue, 23 September 2003 11:20 |
Eclipse User |
|
|
|
Originally posted by: yohai.attunity.co.il
Good morning,
I've implemented a drag & drop feature and i have a problem with the mthod
supportDrop().
I understand that i should implement two supportDrop methods inside the drop
target class. The first one is supportDrop() and the second is
supportDrop(Object).
The first one, without the parameters, is invoked whenever i drag an object
and hover above the target object. The second one is inviked when i try to
actually drop the dragged object (meaning - stop holding down the mouse
button).
The problem - i want to add a condition to the first method supportDrop so
that it will return true if and only if the dragged node (i'm dragging
objects in a tree) is of the same type as the children of the target node.
for eample, i'd like to code somethinf like that -
public boolean supportdrop() {
return
(draggedNode.getParent().getClass().equals(targetNode.getCla ss()));
}
but i don't know how can i get the dragged node! I can't get it by the
getSelection() because while dragging an object and moving with the mouse,
the selection is lost. Also - I don't know how to get the target node.
Please help me...
____________________________________________________________ ______ yohai
ICQ#: 81309797 Current ICQ status: + More ways to contact me
____________________________________________________________ ______
|
|
|
Powered by
FUDForum. Page generated in 0.02869 seconds