|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.extjs.gxt.ui.client.event.BaseObservable
com.extjs.gxt.ui.client.dnd.DragSource
public class DragSource
Identifies a component that drag and drops can be initiated from.
Drag sources must set the data that will be dragged during a drag operation. The data can be specified either by usingsetData(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
component 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(DNDEvent)
and listeners.
Field Summary | |
---|---|
protected Component |
component
|
protected java.lang.Object |
data
|
protected Draggable |
draggable
|
protected DragListener |
listener
|
protected StatusProxy |
statusProxy
|
Constructor Summary | |
---|---|
DragSource(Component component)
|
Method Summary | |
---|---|
void |
addDNDListener(DNDListener listener)
Adds a drag and drop listener. |
void |
disable()
Disables the drag source. |
void |
enable()
Enables the drag source. |
Component |
getComponent()
Returns the source component. |
java.lang.Object |
getData()
Returns the data to be moved or copied. |
Draggable |
getDraggable()
Returns the draggable instance. |
java.lang.String |
getGroup()
Returns the source's drag drop group. |
java.lang.String |
getStatusText()
Returns the status text. |
boolean |
isEnabled()
Returns true if the drag source is enabled. |
protected void |
onDragCancelled(DNDEvent event)
Called when a drag operation has been cancelled. |
protected void |
onDragDrop(DNDEvent event)
|
protected void |
onDragFail(DNDEvent event)
|
protected void |
onDragStart(DNDEvent event)
Called when a drag operation begins on the target component. |
void |
release()
Releases the DragSource from the component. |
void |
removeDNDListener(DNDListener listener)
Removes the drag and drop listener. |
void |
setData(java.lang.Object data)
Sets the data for the drag drop operation. |
void |
setGroup(java.lang.String group)
Sets the drag drop group. |
void |
setStatusText(java.lang.String statusText)
Sets the text to be used on the status proxy object. |
Methods inherited from class com.extjs.gxt.ui.client.event.BaseObservable |
---|
addListener, callListener, fireEvent, fireEvent, getFiresEvents, getListeners, hasActiveEvent, hasListeners, hasListeners, removeAllListeners, removeListener, setFiresEvents |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Component component
protected Draggable draggable
protected DragListener listener
protected java.lang.Object data
protected StatusProxy statusProxy
Constructor Detail |
---|
public DragSource(Component component)
component
- Method Detail |
---|
public void addDNDListener(DNDListener listener)
listener
- the listener to addpublic void disable()
public void enable()
public Component getComponent()
public java.lang.Object getData()
public Draggable getDraggable()
public java.lang.String getGroup()
public java.lang.String getStatusText()
public boolean isEnabled()
public void release()
public void removeDNDListener(DNDListener listener)
listener
- the listener to removepublic void setData(java.lang.Object data)
data
- the datapublic void setGroup(java.lang.String group)
group
- the group namepublic void setStatusText(java.lang.String statusText)
statusText
- the status textprotected void onDragCancelled(DNDEvent event)
event
- the dnd eventprotected void onDragDrop(DNDEvent event)
protected void onDragFail(DNDEvent event)
protected void onDragStart(DNDEvent event)
BaseEvent.setCancelled(boolean)
.
event
- the dnd event
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |