Class GridDropTargetEffect
- java.lang.Object
-
- org.eclipse.swt.dnd.DropTargetAdapter
-
- org.eclipse.swt.dnd.DropTargetEffect
-
- org.eclipse.nebula.widgets.grid.GridDropTargetEffect
-
- All Implemented Interfaces:
java.util.EventListener,org.eclipse.swt.dnd.DropTargetListener,org.eclipse.swt.internal.SWTEventListener
public class GridDropTargetEffect extends org.eclipse.swt.dnd.DropTargetEffectThis class provides a default drag under effect (eg. select, insert, scroll and expand) when a drag occurs over aGrid.Classes that wish to provide their own drag under effect for a
Subclasses that override any methods of this class must call the correspondingGridcan extend theDropTargetAdapterclass and override any applicable methods inDropTargetAdapterto display their own drag under effect.supermethod to get the default drag under effect implementation.The feedback value is either one of the FEEDBACK constants defined in class
DNDwhich is applicable to instances of this class, or it must be built by bitwise OR'ing together (that is, using theint"|" operator) two or more of thoseDNDeffect constants.- Feedback:
- FEEDBACK_SELECT, FEEDBACK_INSERT_BEFORE, FEEDBACK_INSERT_AFTER, FEEDBACK_EXPAND, FEEDBACK_SCROLL
Note: Only one of the styles FEEDBACK_SELECT, FEEDBACK_INSERT_BEFORE or FEEDBACK_INSERT_AFTER may be specified.
- Since:
- 3.3
- See Also:
DropTargetAdapter,DropTargetEvent
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static intEXPAND_HYSTERESISprivate longexpandBeginTimeprivate GridItemexpandItemprivate Gridgridprivate booleanignoreCellSelectionprivate booleaninsertBeforeprivate org.eclipse.swt.graphics.PointinsertCell(package private) static intSCROLL_HYSTERESISprivate longscrollBeginTimeprivate GridItemscrollItemprivate org.eclipse.swt.graphics.PointselectedCell
-
Constructor Summary
Constructors Constructor Description GridDropTargetEffect(Grid grid)Creates a newGridDropTargetEffectto handle the drag under effect on the specifiedGrid.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) intcheckEffect(int effect)private voiddeselect(org.eclipse.swt.graphics.Point cell)voiddragEnter(org.eclipse.swt.dnd.DropTargetEvent event)This implementation ofdragEnterprovides a default drag under effect for the feedback specified inevent.feedback.voiddragLeave(org.eclipse.swt.dnd.DropTargetEvent event)This implementation ofdragLeaveprovides a default drag under effect for the feedback specified inevent.feedback.voiddragOver(org.eclipse.swt.dnd.DropTargetEvent event)This implementation ofdragOverprovides a default drag under effect for the feedback specified inevent.feedback.booleangetIgnoreCellSelection()org.eclipse.swt.widgets.WidgetgetItem(int x, int y)private voidselect(org.eclipse.swt.graphics.Point cell)voidsetIgnoreCellSelection(boolean ignore)Set this value to true to make drop feedback inGridalways behave like the Grid was not in cell selection mode.private voidsetInsertMark(org.eclipse.swt.graphics.Point cell, boolean before)
-
-
-
Field Detail
-
SCROLL_HYSTERESIS
static final int SCROLL_HYSTERESIS
- See Also:
- Constant Field Values
-
EXPAND_HYSTERESIS
static final int EXPAND_HYSTERESIS
- See Also:
- Constant Field Values
-
grid
private Grid grid
-
ignoreCellSelection
private boolean ignoreCellSelection
-
scrollItem
private GridItem scrollItem
-
scrollBeginTime
private long scrollBeginTime
-
expandItem
private GridItem expandItem
-
expandBeginTime
private long expandBeginTime
-
insertCell
private org.eclipse.swt.graphics.Point insertCell
-
insertBefore
private boolean insertBefore
-
selectedCell
private org.eclipse.swt.graphics.Point selectedCell
-
-
Constructor Detail
-
GridDropTargetEffect
public GridDropTargetEffect(Grid grid)
Creates a newGridDropTargetEffectto handle the drag under effect on the specifiedGrid.- Parameters:
grid- theGridover which the user positions the cursor to drop the data
-
-
Method Detail
-
setIgnoreCellSelection
public void setIgnoreCellSelection(boolean ignore)
Set this value to true to make drop feedback inGridalways behave like the Grid was not in cell selection mode. The default is false.A value of true, means that for
DND.FEEDBACK_SELECTfull rows will be selected instead of cells and forDND.FEEDBACK_INSERT_AFTERandDND.FEEDBACK_INSERT_BEFOREthe insert mark will span all columns.- Parameters:
ignore-
-
getIgnoreCellSelection
public boolean getIgnoreCellSelection()
- Returns:
- true if cell selection mode is ignored
- See Also:
setIgnoreCellSelection(boolean)
-
checkEffect
int checkEffect(int effect)
-
getItem
public org.eclipse.swt.widgets.Widget getItem(int x, int y)- Overrides:
getItemin classorg.eclipse.swt.dnd.DropTargetEffect
-
dragEnter
public void dragEnter(org.eclipse.swt.dnd.DropTargetEvent event)
This implementation ofdragEnterprovides a default drag under effect for the feedback specified inevent.feedback. For additional information seeDropTargetAdapter.dragEnter. Subclasses that override this method should callsuper.dragEnter(event)to get the default drag under effect implementation.- Specified by:
dragEnterin interfaceorg.eclipse.swt.dnd.DropTargetListener- Overrides:
dragEnterin classorg.eclipse.swt.dnd.DropTargetAdapter- Parameters:
event- the information associated with the drag enter event- See Also:
DropTargetAdapter,DropTargetEvent
-
dragLeave
public void dragLeave(org.eclipse.swt.dnd.DropTargetEvent event)
This implementation ofdragLeaveprovides a default drag under effect for the feedback specified inevent.feedback. For additional information seeDropTargetAdapter.dragLeave. Subclasses that override this method should callsuper.dragLeave(event)to get the default drag under effect implementation.- Specified by:
dragLeavein interfaceorg.eclipse.swt.dnd.DropTargetListener- Overrides:
dragLeavein classorg.eclipse.swt.dnd.DropTargetAdapter- Parameters:
event- the information associated with the drag leave event- See Also:
DropTargetAdapter,DropTargetEvent
-
dragOver
public void dragOver(org.eclipse.swt.dnd.DropTargetEvent event)
This implementation ofdragOverprovides a default drag under effect for the feedback specified inevent.feedback. For additional information seeDropTargetAdapter.dragOver. Subclasses that override this method should callsuper.dragOver(event)to get the default drag under effect implementation.- Specified by:
dragOverin interfaceorg.eclipse.swt.dnd.DropTargetListener- Overrides:
dragOverin classorg.eclipse.swt.dnd.DropTargetAdapter- Parameters:
event- the information associated with the drag over event- See Also:
DropTargetAdapter,DropTargetEvent,DND.FEEDBACK_SELECT,DND.FEEDBACK_INSERT_BEFORE,DND.FEEDBACK_INSERT_AFTER,DND.FEEDBACK_SCROLL,DND.FEEDBACK_EXPAND
-
select
private void select(org.eclipse.swt.graphics.Point cell)
-
deselect
private void deselect(org.eclipse.swt.graphics.Point cell)
-
setInsertMark
private void setInsertMark(org.eclipse.swt.graphics.Point cell, boolean before)
-
-