Eclipse Rich Ajax Platform

org.eclipse.swt.dnd
Class DragSourceEvent

java.lang.Object
  extended by Event
      extended by org.eclipse.swt.events.TypedEvent
          extended by org.eclipse.swt.dnd.DragSourceEvent

public class DragSourceEvent
extends TypedEvent

The DragSourceEvent contains the event information passed in the methods of the DragSourceListener.

Since:
1.3
See Also:
DragSourceListener

Field Summary
 TransferData dataType
          The type of data requested.
 int detail
          The operation that was performed.
 boolean doit
          In dragStart, the doit field determines if the drag and drop operation should proceed; in dragFinished, the doit field indicates whether the operation was performed successfully.
static int DRAG_END
           
static int DRAG_SET_DATA
           
static int DRAG_START
           
 Image image
          The drag source image to be displayed during the drag.
 int offsetX
          In dragStart, the x offset (relative to the image) where the drag source image will be displayed.
 int offsetY
          In dragStart, the y offset (relative to the image) where the drag source image will be displayed.
 int time
          the time that the event occurred.
 int x
          In dragStart, the x coordinate (relative to the control) of the position the mouse went down to start the drag.
 int y
          In dragStart, the y coordinate (relative to the control) of the position the mouse went down to start the drag.
 
Fields inherited from class org.eclipse.swt.events.TypedEvent
data, display, widget
 
Constructor Summary
DragSourceEvent(Widget widget, int id)
           
 
Method Summary
static void addListener(Adaptable adaptable, DragSourceListener listener)
           
protected  boolean allowProcessing()
           
protected  void dispatchToObserver(java.lang.Object listener)
           
static java.lang.Object[] getListeners(Adaptable adaptable)
           
protected  java.lang.Class getListenerType()
           
static boolean hasListener(Adaptable adaptable)
           
static void removeListener(Adaptable adaptable, DragSourceListener listener)
           
 java.lang.String toString()
           
 
Methods inherited from class org.eclipse.swt.events.TypedEvent
executeNext, getSource, processEvent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DRAG_START

public static final int DRAG_START
See Also:
Constant Field Values

DRAG_END

public static final int DRAG_END
See Also:
Constant Field Values

DRAG_SET_DATA

public static final int DRAG_SET_DATA
See Also:
Constant Field Values

detail

public int detail
The operation that was performed.

See Also:
DND.DROP_NONE, DND.DROP_MOVE, DND.DROP_COPY, DND.DROP_LINK, DND.DROP_TARGET_MOVE

doit

public boolean doit
In dragStart, the doit field determines if the drag and drop operation should proceed; in dragFinished, the doit field indicates whether the operation was performed successfully.

In dragStart:

Flag to determine if the drag and drop operation should proceed. The application can set this value to false to prevent the drag from starting. Set to true by default.

In dragSetData:

This will be set to true when the call to dragSetData is made. Set it to false to cancel the drag.

In dragFinished:

Flag to indicate if the operation was performed successfully. True if the operation was performed successfully.


x

public int x
In dragStart, the x coordinate (relative to the control) of the position the mouse went down to start the drag.


y

public int y
In dragStart, the y coordinate (relative to the control) of the position the mouse went down to start the drag.


dataType

public TransferData dataType
The type of data requested. Data provided in the data field must be of the same type.


image

public Image image
The drag source image to be displayed during the drag.

A value of null indicates that no drag image will be displayed.

The default value is null.


offsetX

public int offsetX
In dragStart, the x offset (relative to the image) where the drag source image will be displayed.


offsetY

public int offsetY
In dragStart, the y offset (relative to the image) where the drag source image will be displayed.


time

public int time
the time that the event occurred. NOTE: This field is an unsigned integer and should be AND'ed with 0xFFFFFFFFL so that it can be treated as a signed long.

Constructor Detail

DragSourceEvent

public DragSourceEvent(Widget widget,
                       int id)
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class TypedEvent

dispatchToObserver

protected void dispatchToObserver(java.lang.Object listener)
Overrides:
dispatchToObserver in class TypedEvent

allowProcessing

protected boolean allowProcessing()
Overrides:
allowProcessing in class TypedEvent

getListenerType

protected java.lang.Class getListenerType()
Overrides:
getListenerType in class TypedEvent

hasListener

public static boolean hasListener(Adaptable adaptable)

addListener

public static void addListener(Adaptable adaptable,
                               DragSourceListener listener)

removeListener

public static void removeListener(Adaptable adaptable,
                                  DragSourceListener listener)

getListeners

public static java.lang.Object[] getListeners(Adaptable adaptable)

Eclipse Rich Ajax Platform

Copyright (c) EclipseSource and others 2002, 2012. All rights reserved.