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

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.GridDropTarget
All Implemented Interfaces:
Observable

public class GridDropTarget
extends DropTarget

A DropTarget implementation for Grids. Supports both inserts and appends, specified using DropTarget.setOperation(com.extjs.gxt.ui.client.dnd.DND.Operation).

Supported drag data:


Field Summary
protected  ModelData activeItem
           
protected  Grid<ModelData> grid
           
protected  int insertIndex
           
 
Fields inherited from class com.extjs.gxt.ui.client.dnd.DropTarget
component, feedback, operation, overStyle
 
Constructor Summary
GridDropTarget(Grid grid)
          Creates a new drop target instance.
 
Method Summary
 Grid<ModelData> getGrid()
          Returns the target grid component.
 boolean isAutoScroll()
          Returns true if auto scroll is enabled (defaults to true).
protected  void onDragCancelled(DNDEvent event)
          Called if the user cancels the drag operations while the mouse is over the target.
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 onDragFail(DNDEvent event)
           
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 setAutoScroll(boolean autoScroll)
          True to automatically scroll the tree when the user hovers over the top and bottom of the tree grid (defaults to true).
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, 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

activeItem

protected ModelData activeItem

grid

protected Grid<ModelData> grid

insertIndex

protected int insertIndex
Constructor Detail

GridDropTarget

public GridDropTarget(Grid grid)
Creates a new drop target instance.

Parameters:
grid - the target grid
Method Detail

getGrid

public Grid<ModelData> getGrid()
Returns the target grid component.

Returns:
the grid

isAutoScroll

public boolean isAutoScroll()
Returns true if auto scroll is enabled (defaults to true).

Returns:
true if auto scroll enabled

setAutoScroll

public void setAutoScroll(boolean autoScroll)
True to automatically scroll the tree when the user hovers over the top and bottom of the tree grid (defaults to true).

Parameters:
autoScroll - true to enable auto scroll
See Also:
ScrollSupport

onDragCancelled

protected void onDragCancelled(DNDEvent event)
Description copied from class: DropTarget
Called if the user cancels the drag operations while the mouse is over the target.

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

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

onDragFail

protected void onDragFail(DNDEvent event)
Overrides:
onDragFail in class DropTarget

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

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