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

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

public class ListViewDropTarget
extends DropTarget

A DropTarget implementation for the ListView component. Supported drag data:


Field Summary
protected  ModelData activeItem
           
protected  boolean before
           
protected  int insertIndex
           
protected  ListView<ModelData> listView
           
 
Fields inherited from class com.extjs.gxt.ui.client.dnd.DropTarget
component, feedback, operation, overStyle
 
Constructor Summary
ListViewDropTarget(ListView listView)
          Creates a new list view drop target instance.
 
Method Summary
 ListView<ModelData> getListView()
          Returns the target's list view component.
 boolean isAutoSelect()
          Returns true if auto select is enabled.
protected  void onDragDrop(DNDEvent e)
          Called when the user releases the mouse over the target component.
protected  void onDragEnter(DNDEvent e)
          Called when the cursor first enters the bounds of the drop target.
protected  void onDragLeave(DNDEvent e)
          Called when the cursor leaves the target.
protected  void onDragMove(DNDEvent event)
          Called when the cursor is moved within the target component.
 void setAutoSelect(boolean autoSelect)
          True to automatically select and new items created after a drop (defaults to false).
protected  void showFeedback(DNDEvent event)
          Called as the mouse is moved over the target component.
 
Methods inherited from class com.extjs.gxt.ui.client.dnd.DropTarget
addDNDListener, disable, enable, getComponent, getFeedback, getGroup, getOperation, getOverStyle, isAllowSelfAsSource, isEnabled, onComponentAttach, onComponentDetach, onDragCancelled, onDragFail, prepareDropData, release, removeDNDListener, setAllowSelfAsSource, setFeedback, setGroup, setOperation, setOverStyle
 
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

listView

protected ListView<ModelData> listView

insertIndex

protected int insertIndex

activeItem

protected ModelData activeItem

before

protected boolean before
Constructor Detail

ListViewDropTarget

public ListViewDropTarget(ListView listView)
Creates a new list view drop target instance.

Parameters:
listView - the target list view
Method Detail

getListView

public ListView<ModelData> getListView()
Returns the target's list view component.

Returns:
the list view

isAutoSelect

public boolean isAutoSelect()
Returns true if auto select is enabled.

Returns:
the auto select state

onDragDrop

protected void onDragDrop(DNDEvent e)
Description copied from class: DropTarget
Called when the user releases the mouse over the target component.

Overrides:
onDragDrop in class DropTarget
Parameters:
e - the dd event

onDragEnter

protected void onDragEnter(DNDEvent e)
Description copied from class: DropTarget
Called when the cursor first enters the bounds of the drop target. Subclasses or listeners can change the status of status proxy via the passed event.

Overrides:
onDragEnter in class DropTarget
Parameters:
e - the dd event

onDragLeave

protected void onDragLeave(DNDEvent e)
Description copied from class: DropTarget
Called when the cursor leaves the target.

Overrides:
onDragLeave in class DropTarget
Parameters:
e - the dd event

onDragMove

protected void onDragMove(DNDEvent event)
Description copied from class: DropTarget
Called when the cursor is moved within the target component. Subclasses or listeners can change the status of status proxy via the passed event. If either a subclass or listener sets BaseEvent.setCancelled(boolean) to true, DropTarget.showFeedback(DNDEvent) will be called.

Overrides:
onDragMove in class DropTarget
Parameters:
event - the dd event

setAutoSelect

public void setAutoSelect(boolean autoSelect)
True to automatically select and new items created after a drop (defaults to false).

Parameters:
autoSelect - true to auto select

showFeedback

protected void showFeedback(DNDEvent event)
Description copied from class: DropTarget
Called as the mouse is moved over the target component. The default implementation does nothing.

Overrides:
showFeedback in class DropTarget
Parameters:
event - the dd event