org.eclipse.swt.dnd
Class DND

java.lang.Object
  |
  +--org.eclipse.swt.dnd.DND

public class DND
extends Object

Untamed: Class DND contains all the constants used in defining a DragSource or a DropTarget.


Field Summary
(package private) static String CANNOT_SET_CLIPBOARD_MESSAGE
           
static int DragEnd
          Enabled: DragSource Event: the drop has successfully completed or has been terminated (such as hitting the ESC key); perform cleanup such as removing data on a move operation (value is 2000).
static int DragEnter
          Enabled: DropTarget Event: the cursor has entered the drop target boundaries (value is 2002).
static int DragLeave
          Enabled: DropTarget Event: the cursor has left the drop target boundaries OR the drop operation has been cancelled (such as by hitting ECS) OR the drop is about to happen (user has released the mous ebutotn over this target) (value is 2003).
static int DragOperationChanged
          Enabled: DropTarget Event: the operation being performed has changed usually due to the user changing the selected modifier keys while dragging (value is 2005).
static int DragOver
          Enabled: DropTarget Event: the cursor is over the drop target (value is 2004).
static int DragSetData
          Enabled: DragSource Event: the data to be dropped is required from the drag source (value is 2001).
static int DragStart
          Enabled: DragSource Event: a drag is about to begin (value is 2008).
static int Drop
          Enabled: DropTarget Event: the data has been dropped (value is 2006).
static int DROP_COPY
          Enabled: Drag and Drop Operation: a copy of the data in the drag source is added to the drop target (value is 1 << 0).
static int DROP_DEFAULT
          Enabled: Drag and Drop Operation: During a dragEnter event or a dragOperationChanged, if no modifier keys are pressed, the operation is set to DROP_DEFAULT.
static int DROP_LINK
          Enabled: Drag and Drop Operation: the drop target makes a link to the data in the drag source (value is 1 << 2).
static int DROP_MOVE
          Enabled: Drag and Drop Operation: a copy of the data is added to the drop target and the original data is removed from the drag source (value is 1 << 1).
static int DROP_NONE
          Enabled: Drag and Drop Operation: no drag/drop operation performed (value is 0).
static int DROP_TARGET_MOVE
          Enabled: Drag and Drop Operation: the drop target moves the data and the drag source removes any references to the data and updates its display.
static int DropAccept
          Enabled: DropTarget Event: the drop target is given a last chance to modify the drop (value is 2007).
static int ERROR_CANNOT_INIT_DRAG
          Enabled: Error code: drag source can not be initialized (value is 2000).
static int ERROR_CANNOT_INIT_DROP
          Enabled: Error code: drop target cannot be initialized (value is 2001).
static int ERROR_CANNOT_SET_CLIPBOARD
          Enabled: Error code: Data can not be set on system clipboard (value is 2002).
static int FEEDBACK_EXPAND
          Enabled: DropTarget drag under effect: The item currently under the cursor is expanded to allow the user to select a drop target from a sub item; applies to trees (value is 16).
static int FEEDBACK_INSERT_AFTER
          Enabled: DropTarget drag under effect:An insertion mark is shown after the item under the cursor; applies to tables and trees (value is 4).
static int FEEDBACK_INSERT_BEFORE
          Enabled: DropTarget drag under effect: An insertion mark is shown before the item under the cursor; applies to tables and trees (value is 2).
static int FEEDBACK_NONE
          Enabled: DropTarget drag under effect: No effect is shown (value is 0).
static int FEEDBACK_SCROLL
          Enabled: DropTarget drag under effect: The widget is scrolled up or down to allow the user to drop on items that are not currently visible; applies to tables and trees (value is 8).
static int FEEDBACK_SELECT
          Enabled: DropTarget drag under effect: The item under the cursor is selected; applies to tables and trees (value is 1).
(package private) static String INIT_DRAG_MESSAGE
           
(package private) static String INIT_DROP_MESSAGE
           
 
Constructor Summary
DND()
          Enabled:
 
Method Summary
static void error(int code)
          Enabled: Throws an appropriate exception based on the passed in error code.
static void error(int code, int hresult)
          Enabled: Throws an appropriate exception based on the passed in error code.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DROP_NONE

public static final int DROP_NONE
Enabled: Drag and Drop Operation: no drag/drop operation performed (value is 0).


DROP_COPY

public static final int DROP_COPY
Enabled: Drag and Drop Operation: a copy of the data in the drag source is added to the drop target (value is 1 << 0).


DROP_MOVE

public static final int DROP_MOVE
Enabled: Drag and Drop Operation: a copy of the data is added to the drop target and the original data is removed from the drag source (value is 1 << 1).


DROP_LINK

public static final int DROP_LINK
Enabled: Drag and Drop Operation: the drop target makes a link to the data in the drag source (value is 1 << 2).


DROP_TARGET_MOVE

public static final int DROP_TARGET_MOVE
Enabled: Drag and Drop Operation: the drop target moves the data and the drag source removes any references to the data and updates its display. This is not available on all platforms and is only used when a non-SWT application is the drop target. In this case, the SWT drag source is informed in the dragFinished event that the drop target has moved the data. (value is 1 << 3).

See Also:
DragSourceListener.dragFinished(org.eclipse.swt.dnd.DragSourceEvent)

DROP_DEFAULT

public static final int DROP_DEFAULT
Enabled: Drag and Drop Operation: During a dragEnter event or a dragOperationChanged, if no modifier keys are pressed, the operation is set to DROP_DEFAULT. The application can choose what the default operation should be by setting a new value in the operation field. If no value is choosen, the default operation for the platform will be selected (value is 1 << 4).

Since:
2.0
See Also:
DropTargetListener.dragEnter(org.eclipse.swt.dnd.DropTargetEvent), DropTargetListener.dragOperationChanged(org.eclipse.swt.dnd.DropTargetEvent)

DragEnd

public static final int DragEnd
Enabled: DragSource Event: the drop has successfully completed or has been terminated (such as hitting the ESC key); perform cleanup such as removing data on a move operation (value is 2000).


DragSetData

public static final int DragSetData
Enabled: DragSource Event: the data to be dropped is required from the drag source (value is 2001).


DragEnter

public static final int DragEnter
Enabled: DropTarget Event: the cursor has entered the drop target boundaries (value is 2002).


DragLeave

public static final int DragLeave
Enabled: DropTarget Event: the cursor has left the drop target boundaries OR the drop operation has been cancelled (such as by hitting ECS) OR the drop is about to happen (user has released the mous ebutotn over this target) (value is 2003).


DragOver

public static final int DragOver
Enabled: DropTarget Event: the cursor is over the drop target (value is 2004).


DragOperationChanged

public static final int DragOperationChanged
Enabled: DropTarget Event: the operation being performed has changed usually due to the user changing the selected modifier keys while dragging (value is 2005).


Drop

public static final int Drop
Enabled: DropTarget Event: the data has been dropped (value is 2006).


DropAccept

public static final int DropAccept
Enabled: DropTarget Event: the drop target is given a last chance to modify the drop (value is 2007).


DragStart

public static final int DragStart
Enabled: DragSource Event: a drag is about to begin (value is 2008).


FEEDBACK_NONE

public static final int FEEDBACK_NONE
Enabled: DropTarget drag under effect: No effect is shown (value is 0).


FEEDBACK_SELECT

public static final int FEEDBACK_SELECT
Enabled: DropTarget drag under effect: The item under the cursor is selected; applies to tables and trees (value is 1).


FEEDBACK_INSERT_BEFORE

public static final int FEEDBACK_INSERT_BEFORE
Enabled: DropTarget drag under effect: An insertion mark is shown before the item under the cursor; applies to tables and trees (value is 2).


FEEDBACK_INSERT_AFTER

public static final int FEEDBACK_INSERT_AFTER
Enabled: DropTarget drag under effect:An insertion mark is shown after the item under the cursor; applies to tables and trees (value is 4).


FEEDBACK_SCROLL

public static final int FEEDBACK_SCROLL
Enabled: DropTarget drag under effect: The widget is scrolled up or down to allow the user to drop on items that are not currently visible; applies to tables and trees (value is 8).


FEEDBACK_EXPAND

public static final int FEEDBACK_EXPAND
Enabled: DropTarget drag under effect: The item currently under the cursor is expanded to allow the user to select a drop target from a sub item; applies to trees (value is 16).


ERROR_CANNOT_INIT_DRAG

public static final int ERROR_CANNOT_INIT_DRAG
Enabled: Error code: drag source can not be initialized (value is 2000).


ERROR_CANNOT_INIT_DROP

public static final int ERROR_CANNOT_INIT_DROP
Enabled: Error code: drop target cannot be initialized (value is 2001).


ERROR_CANNOT_SET_CLIPBOARD

public static final int ERROR_CANNOT_SET_CLIPBOARD
Enabled: Error code: Data can not be set on system clipboard (value is 2002).


INIT_DRAG_MESSAGE

static final String INIT_DRAG_MESSAGE

INIT_DROP_MESSAGE

static final String INIT_DROP_MESSAGE

CANNOT_SET_CLIPBOARD_MESSAGE

static final String CANNOT_SET_CLIPBOARD_MESSAGE
Constructor Detail

DND

public DND()
Enabled:

Method Detail

error

public static void error(int code)
Enabled: Throws an appropriate exception based on the passed in error code.

Parameters:
code - the DND error code

error

public static void error(int code,
                         int hresult)
Enabled: Throws an appropriate exception based on the passed in error code. The hresult argument should be either 0, or the platform specific error code.

In DND, errors are reported by throwing one of three exceptions:

java.lang.IllegalArgumentException
thrown whenever one of the API methods is invoked with an illegal argument
org.eclipse.swt.SWTException (extends java.lang.RuntimeException)
thrown whenever a recoverable error happens internally in SWT
org.eclipse.swt.SWTError (extends java.lang.Error)
thrown whenever a non-recoverable error happens internally in SWT
This method provides the logic which maps between error codes and one of the above exceptions.

Parameters:
code - the DND error code.
hresult - the platform specific error code.
See Also:
SWTError, SWTException, IllegalArgumentException


comments?