M
- the model typepublic class ListViewDropTarget<M> extends DropTarget
Enables a ListView
to act as the target of a drag and drop operation.
Use DropTarget.setFeedback(com.sencha.gxt.dnd.core.client.DND.Feedback)
to specify whether to allow inserting items
between rows, appending items to the end, or both (defaults to DND.Feedback.BOTH
).
Use DropTarget.setOperation(com.sencha.gxt.dnd.core.client.DND.Operation)
to specify whether to move items or copy
them (defaults to DND.Operation.MOVE
).
Modifier and Type | Field and Description |
---|---|
protected M |
activeItem |
protected boolean |
before |
protected int |
insertIndex |
protected ListView<M,?> |
listView |
dropWidget, feedback, operation, overStyle
Constructor and Description |
---|
ListViewDropTarget(ListView<M,?> listView)
Creates a drop target for the specified list view.
|
Modifier and Type | Method and Description |
---|---|
ListView<M,?> |
getListView()
Returns the list view associated with this drop target.
|
boolean |
isAutoSelect()
Returns true if auto select is enabled.
|
protected void |
onDragDrop(DndDropEvent event)
Called when the user releases the mouse over the target widget.
|
protected void |
onDragEnter(DndDragEnterEvent event)
Called when the cursor first enters the bounds of the drop target.
|
protected void |
onDragLeave(DndDragLeaveEvent event)
Called when the cursor leaves the target.
|
protected void |
onDragMove(DndDragMoveEvent event)
Called when the cursor is moved within the target widget.
|
void |
setAutoSelect(boolean autoSelect)
True to automatically select any new items created after a drop (defaults to false).
|
protected void |
showFeedback(DndDragMoveEvent event)
Called as the mouse is moved over the target widget.
|
addDragCancelHandler, addDragEnterHandler, addDragLeaveHandler, addDragMoveHandler, addDropHandler, disable, enable, getElementFromEvent, getFeedback, getGroup, getOperation, getOverStyle, getWidget, isAllowSelfAsSource, isEnabled, onDragCancelled, onDragFail, onDropWidgetAttach, onDropWidgetDetach, prepareDropData, release, setAllowSelfAsSource, setFeedback, setGroup, setOperation, setOverStyle
protected M activeItem
protected int insertIndex
protected boolean before
public ListView<M,?> getListView()
public boolean isAutoSelect()
public void setAutoSelect(boolean autoSelect)
autoSelect
- true to auto selectprotected void onDragDrop(DndDropEvent event)
DropTarget
onDragDrop
in class DropTarget
event
- the drop eventprotected void onDragEnter(DndDragEnterEvent event)
DropTarget
onDragEnter
in class DropTarget
event
- the drag enter eventprotected void onDragLeave(DndDragLeaveEvent event)
DropTarget
onDragLeave
in class DropTarget
event
- the drag leave eventprotected void onDragMove(DndDragMoveEvent event)
DropTarget
CancellableEvent.setCancelled(boolean)
to true,
DropTarget.showFeedback(DndDragMoveEvent)
will be called.onDragMove
in class DropTarget
event
- the dd eventprotected void showFeedback(DndDragMoveEvent event)
DropTarget
showFeedback
in class DropTarget
event
- the dd eventCopyright © 2018. All rights reserved.