public class TreeDropTargetEffect extends DropTargetEffect
Tree
.
Classes that wish to provide their own drag under effect for a Tree
can extend the TreeDropTargetEffect
class and override any applicable methods
in TreeDropTargetEffect
to display their own drag under effect.
super
method to get the default drag under effect implementation.
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.
Note: Only one of the styles FEEDBACK_SELECT, FEEDBACK_INSERT_BEFORE or FEEDBACK_INSERT_AFTER may be specified.
DropTargetAdapter
,
DropTargetEvent
,
Sample code and further informationConstructor and Description |
---|
TreeDropTargetEffect(Tree tree)
Creates a new
TreeDropTargetEffect to handle the drag under effect on the specified
Tree . |
Modifier and Type | Method and Description |
---|---|
void |
dragEnter(DropTargetEvent event)
This implementation of
dragEnter provides a default drag under effect
for the feedback specified in event.feedback . |
void |
dragLeave(DropTargetEvent event)
This implementation of
dragLeave provides a default drag under effect
for the feedback specified in event.feedback . |
void |
dragOver(DropTargetEvent event)
This implementation of
dragOver provides a default drag under effect
for the feedback specified in event.feedback . |
getControl, getItem
dragOperationChanged, drop, dropAccept
public TreeDropTargetEffect(Tree tree)
TreeDropTargetEffect
to handle the drag under effect on the specified
Tree
.tree
- the Tree
over which the user positions the cursor to drop the datapublic void dragEnter(DropTargetEvent event)
dragEnter
provides a default drag under effect
for the feedback specified in event.feedback
.
For additional information see DropTargetAdapter.dragEnter
.
Subclasses that override this method should call super.dragEnter(event)
to get the default drag under effect implementation.dragEnter
in interface DropTargetListener
dragEnter
in class DropTargetAdapter
event
- the information associated with the drag enter eventDropTargetAdapter
,
DropTargetEvent
public void dragLeave(DropTargetEvent event)
dragLeave
provides a default drag under effect
for the feedback specified in event.feedback
.
For additional information see DropTargetAdapter.dragLeave
.
Subclasses that override this method should call super.dragLeave(event)
to get the default drag under effect implementation.dragLeave
in interface DropTargetListener
dragLeave
in class DropTargetAdapter
event
- the information associated with the drag leave eventDropTargetAdapter
,
DropTargetEvent
public void dragOver(DropTargetEvent event)
dragOver
provides a default drag under effect
for the feedback specified in event.feedback
.
For additional information see DropTargetAdapter.dragOver
.
Subclasses that override this method should call super.dragOver(event)
to get the default drag under effect implementation.dragOver
in interface DropTargetListener
dragOver
in class DropTargetAdapter
event
- the information associated with the drag over eventDropTargetAdapter
,
DropTargetEvent
,
DND.FEEDBACK_SELECT
,
DND.FEEDBACK_INSERT_BEFORE
,
DND.FEEDBACK_INSERT_AFTER
,
DND.FEEDBACK_SCROLL
Copyright © 2017. All Rights Reserved.