Top Description Fields Constructors Methods
org.eclipse.swt.dnd

public Class DropTargetEffect

extends DropTargetAdapter
Class Inheritance
Known Direct Subclasses
org.eclipse.swt.dnd.TableDropTargetEffect, org.eclipse.swt.dnd.TreeDropTargetEffect, org.eclipse.swt.custom.StyledTextDropTargetEffect
Imports
org.eclipse.swt.*, org.eclipse.swt.graphics.*, org.eclipse.swt.widgets.*

This class provides a default drag under effect during a drag and drop. The current implementation does not provide any visual feedback.

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.

Feedback:
FEEDBACK_EXPAND, FEEDBACK_INSERT_AFTER, FEEDBACK_INSERT_BEFORE, FEEDBACK_NONE, FEEDBACK_SELECT, FEEDBACK_SCROLL
Since
3.3
See Also
DropTargetAdapter, DropTargetEvent, Sample code and further information

Field Summary

Modifier and TypeField and Description
pack-priv Control

Constructor Summary

AccessConstructor and Description
public
DropTargetEffect(Control
the Control over which the user positions the cursor to drop the data
control
)

Creates a new DropTargetEffect to handle the drag under effect on the specified Control.

Method Summary

Modifier and TypeMethod and Description
public Control

Returns:

the Control which is registered for this DropTargetEffect
getControl
()

Returns the Control which is registered for this DropTargetEffect.

public Widget

Returns:

the item at the given x-y coordinate, or null if the coordinate is not in a selectable item
getItem
(int
the x coordinate used to locate the item
x
,
int
the y coordinate used to locate the item
y
)

Returns the item at the given x-y coordinate in the receiver or null if no such item exists.

pack-priv Widget
getItem(Table table, int x, int y)

pack-priv Widget
getItem(Tree tree, int x, int y)

pack-priv TreeItem
nextItem(Tree tree, TreeItem item)

pack-priv TreeItem
Inherited from org.eclipse.swt.dnd.DropTargetAdapter:
dragEnterdragLeavedragOperationChangeddragOverdropdropAccept

Field Detail

controlback to summary
pack-priv Control control

Constructor Detail

DropTargetEffectback to summary
public DropTargetEffect(Control control)

Creates a new DropTargetEffect to handle the drag under effect on the specified Control.

Parameters
control:Control

the Control over which the user positions the cursor to drop the data

Exceptions
IllegalArgumentException:
  • ERROR_NULL_ARGUMENT - if the control is null

Method Detail

getControlback to summary
public Control getControl()

Returns the Control which is registered for this DropTargetEffect. This is the control over which the user positions the cursor to drop the data.

Returns:Control

the Control which is registered for this DropTargetEffect

getItemback to summary
public 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. The x-y coordinate is in the display relative coordinates.

Parameters
x:int

the x coordinate used to locate the item

y:int

the y coordinate used to locate the item

Returns:Widget

the item at the given x-y coordinate, or null if the coordinate is not in a selectable item

getItemback to summary
pack-priv Widget getItem(Table table, int x, int y)
getItemback to summary
pack-priv Widget getItem(Tree tree, int x, int y)
nextItemback to summary
pack-priv TreeItem nextItem(Tree tree, TreeItem item)
previousItemback to summary
pack-priv TreeItem previousItem(Tree tree, TreeItem item)