public class GridDropTargetEffect
extends org.eclipse.swt.dnd.DropTargetEffect
Grid.
Classes that wish to provide their own drag under effect for a Grid
can extend the DropTargetAdapter class and override any applicable methods
in DropTargetAdapter 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| Modifier and Type | Field and Description |
|---|---|
(package private) static int |
EXPAND_HYSTERESIS |
(package private) static int |
SCROLL_HYSTERESIS |
| Constructor and Description |
|---|
GridDropTargetEffect(Grid grid)
Creates a new
GridDropTargetEffect to handle the drag under effect on the specified
Grid. |
| Modifier and Type | Method and Description |
|---|---|
(package private) int |
checkEffect(int effect) |
void |
dragEnter(org.eclipse.swt.dnd.DropTargetEvent event)
This implementation of
dragEnter provides a default drag under effect
for the feedback specified in event.feedback. |
void |
dragLeave(org.eclipse.swt.dnd.DropTargetEvent event)
This implementation of
dragLeave provides a default drag under effect
for the feedback specified in event.feedback. |
void |
dragOver(org.eclipse.swt.dnd.DropTargetEvent event)
This implementation of
dragOver provides a default drag under effect
for the feedback specified in event.feedback. |
boolean |
getIgnoreCellSelection() |
org.eclipse.swt.widgets.Widget |
getItem(int x,
int y) |
void |
setIgnoreCellSelection(boolean ignore)
Set this value to true to make drop feedback in
Grid
always behave like the Grid was not in cell selection mode. |
static final int SCROLL_HYSTERESIS
static final int EXPAND_HYSTERESIS
public GridDropTargetEffect(Grid grid)
GridDropTargetEffect to handle the drag under effect on the specified
Grid.grid - the Grid over which the user positions the cursor to drop the datapublic void setIgnoreCellSelection(boolean ignore)
Grid
always behave like the Grid was not in cell selection mode.
The default is false.
A value of true, means that for DND.FEEDBACK_SELECT full rows will
be selected instead of cells and for DND.FEEDBACK_INSERT_AFTER and
DND.FEEDBACK_INSERT_BEFORE the insert mark will span all columns.
ignore - public boolean getIgnoreCellSelection()
setIgnoreCellSelection(boolean)int checkEffect(int effect)
public org.eclipse.swt.widgets.Widget getItem(int x,
int y)
getItem in class org.eclipse.swt.dnd.DropTargetEffectpublic void dragEnter(org.eclipse.swt.dnd.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 org.eclipse.swt.dnd.DropTargetListenerdragEnter in class org.eclipse.swt.dnd.DropTargetAdapterevent - the information associated with the drag enter eventDropTargetAdapter,
DropTargetEventpublic void dragLeave(org.eclipse.swt.dnd.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 org.eclipse.swt.dnd.DropTargetListenerdragLeave in class org.eclipse.swt.dnd.DropTargetAdapterevent - the information associated with the drag leave eventDropTargetAdapter,
DropTargetEventpublic void dragOver(org.eclipse.swt.dnd.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 org.eclipse.swt.dnd.DropTargetListenerdragOver in class org.eclipse.swt.dnd.DropTargetAdapterevent - the information associated with the drag over eventDropTargetAdapter,
DropTargetEvent,
DND.FEEDBACK_SELECT,
DND.FEEDBACK_INSERT_BEFORE,
DND.FEEDBACK_INSERT_AFTER,
DND.FEEDBACK_SCROLL,
DND.FEEDBACK_EXPAND