Reputation: 461
I would like to create the following workflow:
I would like to detect the type of box (A or B) during the dragEnter event in the DropTargetListener, so that I can change the cursor to DROP_NONE.
But right now all I can do is detect it during the actual drop event and then throw it away if it is incompatible with the basket.
Please guide me on how to solve this issue.
NOTE: I am using SWT org.eclipse.swt.dnd framework.
SNIPPET:
I would like to do something like this:
public void dragEnter (DropTargetEvent e)
{
Box b = e.getSource // this is the part I need help with
if(b.type == 'B')
e.detail = DROP_NONE;
}
Upvotes: 0
Views: 313
Reputation: 7638
You could create a static variable to keep the current drag source.
You set it in dragStart
and null it in dragFinished
.
Then you use it in dragEnter
and other events to make your evaluations.
Upvotes: 1