public class DropTargetEffect extends DropTargetAdapter
The drop target effect has the same API as the
DropTargetAdapter
so that it can provide custom visual
feedback when a DropTargetEvent
occurs.
Classes that wish to provide their own drag under effect
can extend the DropTargetEffect
and override any applicable methods
in DropTargetAdapter
to display their own drag under effect.
The feedback value is either one of the FEEDBACK constants defined in
class DND
which is applicable to instances of this class,
or it must be built by bitwise OR'ing together
(that is, using the int
"|" operator) two or more
of those DND
effect constants.
DropTargetAdapter
,
DropTargetEvent
,
Sample code and further informationConstructor and Description |
---|
DropTargetEffect(Control control)
Creates a new
DropTargetEffect to handle the drag under effect on the specified
Control . |
Modifier and Type | Method and Description |
---|---|
Control |
getControl()
Returns the Control which is registered for this DropTargetEffect.
|
Widget |
getItem(int x,
int y)
Returns the item at the given x-y coordinate in the receiver
or null if no such item exists.
|
(package private) Widget |
getItem(Table table,
int x,
int y) |
(package private) Widget |
getItem(Tree tree,
int x,
int y) |
(package private) TreeItem |
nextItem(Tree tree,
TreeItem item) |
(package private) TreeItem |
previousItem(Tree tree,
TreeItem item) |
dragEnter, dragLeave, dragOperationChanged, dragOver, drop, dropAccept
Control control
public DropTargetEffect(Control control)
DropTargetEffect
to handle the drag under effect on the specified
Control
.control
- the Control
over which the user positions the cursor to drop the datajava.lang.IllegalArgumentException
- public Control getControl()
public Widget getItem(int x, int y)
x
- the x coordinate used to locate the itemy
- the y coordinate used to locate the item