com.extjs.gxt.ui.client.dnd
Class TreePanelDragSource

java.lang.Object
  extended by com.extjs.gxt.ui.client.event.BaseObservable
      extended by com.extjs.gxt.ui.client.dnd.DragSource
          extended by com.extjs.gxt.ui.client.dnd.TreePanelDragSource
All Implemented Interfaces:
Observable

public class TreePanelDragSource
extends DragSource

DragSource implementation for TreePanel.


Field Summary
protected  TreePanel<ModelData> tree
           
protected  DND.TreeSource treeSource
           
protected  boolean treeStoreState
           
 
Fields inherited from class com.extjs.gxt.ui.client.dnd.DragSource
component, data, draggable, listener, statusProxy
 
Constructor Summary
TreePanelDragSource(TreePanel tree)
           
 
Method Summary
 DND.TreeSource getTreeSource()
          Returns the type of items that can be dragged.
 boolean isTreeStoreState()
          Returns true if tree store state is enabled.
protected  void onDragDrop(DNDEvent event)
           
protected  void onDragStart(DNDEvent e)
          Called when a drag operation begins on the target component.
 void setTreeSource(DND.TreeSource treeSource)
          Sets which tree items can be dragged (defaults to BOTH).
 void setTreeStoreState(boolean treeStoreState)
          True to use TreeStore.getModelState(ModelData) when setting the drag data (defaults to true).
 
Methods inherited from class com.extjs.gxt.ui.client.dnd.DragSource
addDNDListener, disable, enable, getComponent, getData, getDraggable, getGroup, getStatusText, isEnabled, onDragCancelled, onDragFail, release, removeDNDListener, setData, setGroup, setStatusText
 
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

tree

protected TreePanel<ModelData> tree

treeSource

protected DND.TreeSource treeSource

treeStoreState

protected boolean treeStoreState
Constructor Detail

TreePanelDragSource

public TreePanelDragSource(TreePanel tree)
Method Detail

getTreeSource

public DND.TreeSource getTreeSource()
Returns the type of items that can be dragged.

Returns:
the tree source type

isTreeStoreState

public boolean isTreeStoreState()
Returns true if tree store state is enabled.

Returns:
the tree store state

setTreeSource

public void setTreeSource(DND.TreeSource treeSource)
Sets which tree items can be dragged (defaults to BOTH).

Parameters:
treeSource - the tree source type

setTreeStoreState

public void setTreeStoreState(boolean treeStoreState)
True to use TreeStore.getModelState(ModelData) when setting the drag data (defaults to true). False to return a flat list of the selected models in the tree.

Parameters:
treeStoreState - true to use model state

onDragDrop

protected void onDragDrop(DNDEvent event)
Overrides:
onDragDrop in class DragSource

onDragStart

protected void onDragStart(DNDEvent e)
Description copied from class: DragSource
Called when a drag operation begins on the target component. Subclasses or any listeners can cancel the action by calling BaseEvent.setCancelled(boolean).

Overrides:
onDragStart in class DragSource
Parameters:
e - the dnd event