|
|||||||||
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.DropTarget
public class DropTarget
Identifies components that can receive data from a drag and drop operations.
While the cursor is over a target, the target is responsible for determining if the drop is valid and showing any visual indicators for the drop. TheStatusProxy
object should be used to specify if the drop is valid,
and can also be used to change the values of the proxy object displayed by
the cursor. The status proxy is accessible via the DNDEvent.
Field Summary | |
---|---|
protected Component |
component
|
protected DND.Feedback |
feedback
|
protected DND.Operation |
operation
|
protected java.lang.String |
overStyle
|
Constructor Summary | |
---|---|
DropTarget(Component target)
Creates a new drop target. |
Method Summary | |
---|---|
void |
addDNDListener(DNDListener listener)
Adds the listener to the target. |
void |
disable()
Disables the drag source. |
void |
enable()
Enables the drag source. |
Component |
getComponent()
Returns the target's component. |
DND.Feedback |
getFeedback()
Returns the target's feedback setting. |
java.lang.String |
getGroup()
Returns the target's group name. |
DND.Operation |
getOperation()
Returns the target's operation. |
java.lang.String |
getOverStyle()
Returns the target's over style. |
boolean |
isAllowSelfAsSource()
Returns true if internal drops are allowed. |
boolean |
isEnabled()
Returns true if the drag source is enabled. |
protected void |
onComponentAttach()
|
protected void |
onComponentDetach()
|
protected void |
onDragCancelled(DNDEvent event)
Called if the user cancels the drag operations while the mouse is over the target. |
protected void |
onDragDrop(DNDEvent event)
Called when the user releases the mouse over the target component. |
protected void |
onDragEnter(DNDEvent event)
Called when the cursor first enters the bounds of the drop target. |
protected void |
onDragFail(DNDEvent event)
|
protected void |
onDragLeave(DNDEvent event)
Called when the cursor leaves the target. |
protected void |
onDragMove(DNDEvent event)
Called when the cursor is moved within the target component. |
protected java.util.List<ModelData> |
prepareDropData(java.lang.Object data,
boolean convertTreeStoreModel)
|
void |
release()
Unregisters the target as a drop target. |
void |
removeDNDListener(DNDListener listener)
Removes the listener. |
void |
setAllowSelfAsSource(boolean allowSelfAsSource)
Sets whether internal drops are allowed (defaults to false). |
void |
setFeedback(DND.Feedback feedback)
Sets the target's feedback. |
void |
setGroup(java.lang.String group)
Sets the drag group. |
void |
setOperation(DND.Operation operation)
Sets the operation for the drop target which specifies if data should be moved or copied when dropped. |
void |
setOverStyle(java.lang.String overStyle)
Sets the style name to be applied when the cursor is over the target (defaults to null). |
protected void |
showFeedback(DNDEvent event)
Called as the mouse is moved over the target component. |
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 DND.Feedback feedback
protected DND.Operation operation
protected java.lang.String overStyle
Constructor Detail |
---|
public DropTarget(Component target)
target
- the target componentMethod Detail |
---|
public void addDNDListener(DNDListener listener)
listener
- the listener to addpublic void disable()
public void enable()
public Component getComponent()
public DND.Feedback getFeedback()
public java.lang.String getGroup()
public DND.Operation getOperation()
public java.lang.String getOverStyle()
public boolean isAllowSelfAsSource()
public boolean isEnabled()
public void release()
public void removeDNDListener(DNDListener listener)
listener
- the listener to be removedpublic void setAllowSelfAsSource(boolean allowSelfAsSource)
allowSelfAsSource
- true to allow internal dropspublic void setFeedback(DND.Feedback feedback)
feedback
- the feedbackpublic void setGroup(java.lang.String group)
group
- the group namepublic void setOperation(DND.Operation operation)
operation
- the operationpublic void setOverStyle(java.lang.String overStyle)
overStyle
- the over styleprotected void onComponentAttach()
protected void onComponentDetach()
protected void onDragCancelled(DNDEvent event)
event
- the dd eventprotected void onDragDrop(DNDEvent event)
event
- the dd eventprotected void onDragEnter(DNDEvent event)
event
- the dd eventprotected void onDragFail(DNDEvent event)
protected void onDragLeave(DNDEvent event)
event
- the dd eventprotected void onDragMove(DNDEvent event)
BaseEvent.setCancelled(boolean)
to true, showFeedback(DNDEvent)
will be called.
event
- the dd eventprotected java.util.List<ModelData> prepareDropData(java.lang.Object data, boolean convertTreeStoreModel)
protected void showFeedback(DNDEvent event)
event
- the dd event
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |