public class DragSource extends Object implements DndDragStartEvent.HasDndDragStartHandlers, DndDragCancelEvent.HasDndDragCancelHandlers, DndDropEvent.HasDndDropHandlers
setData(Object) or,
setting the data via the DND event when a drag begins.
Drag sources are responsible for removing the dragged data from the source
widget after a valid drop. Use DropTarget.getOperation() to determine
if the data was copied or moved. The target is accessible via the DNDEvent
passed to onDragDrop(DndDropEvent) and listeners.| Constructor and Description |
|---|
DragSource(Widget widget) |
| Modifier and Type | Method and Description |
|---|---|
HandlerRegistration |
addDragCancelHandler(DndDragCancelEvent.DndDragCancelHandler handler)
Adds a
DndDragCancelEvent.DndDragCancelHandler handler for
DndDragCancelEvent events. |
HandlerRegistration |
addDragStartHandler(DndDragStartEvent.DndDragStartHandler handler)
Adds a
DndDragStartEvent.DndDragStartHandler handler for DndDragStartEvent events. |
HandlerRegistration |
addDropHandler(DndDropEvent.DndDropHandler handler)
Adds a
DndDropEvent.DndDropHandler handler for DndDropEvent events. |
void |
disable()
Disables the drag source.
|
void |
enable()
Enables the drag source.
|
Object |
getData()
Returns the data to be moved or copied.
|
Draggable |
getDraggable()
Returns the draggable instance.
|
String |
getGroup()
Returns the source's drag drop group.
|
String |
getStatusText()
Returns the status text.
|
Widget |
getWidget()
Returns the source widget.
|
boolean |
isEnabled()
Returns true if the drag source is enabled.
|
void |
release()
Releases the DragSource from the widget.
|
void |
setData(Object data)
Sets the data for the drag drop operation.
|
void |
setGroup(String group)
Sets the drag drop group.
|
void |
setStatusText(String statusText)
Sets the text to be used on the status proxy object.
|
public DragSource(Widget widget)
public HandlerRegistration addDragCancelHandler(DndDragCancelEvent.DndDragCancelHandler handler)
DndDragCancelEvent.HasDndDragCancelHandlersDndDragCancelEvent.DndDragCancelHandler handler for
DndDragCancelEvent events.addDragCancelHandler in interface DndDragCancelEvent.HasDndDragCancelHandlershandler - the handlerpublic HandlerRegistration addDragStartHandler(DndDragStartEvent.DndDragStartHandler handler)
DndDragStartEvent.HasDndDragStartHandlersDndDragStartEvent.DndDragStartHandler handler for DndDragStartEvent events.addDragStartHandler in interface DndDragStartEvent.HasDndDragStartHandlershandler - the handlerpublic HandlerRegistration addDropHandler(DndDropEvent.DndDropHandler handler)
DndDropEvent.HasDndDropHandlersDndDropEvent.DndDropHandler handler for DndDropEvent events.addDropHandler in interface DndDropEvent.HasDndDropHandlershandler - the handlerpublic void disable()
public void enable()
public Widget getWidget()
public Object getData()
public Draggable getDraggable()
public String getGroup()
public String getStatusText()
public boolean isEnabled()
public void release()
public void setData(Object data)
data - the datapublic void setGroup(String group)
group - the group namepublic void setStatusText(String statusText)
statusText - the status textCopyright © 2012. All Rights Reserved.