|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.wicket.behavior.Behavior
org.apache.wicket.behavior.AbstractAjaxBehavior
org.apache.wicket.ajax.AbstractDefaultAjaxBehavior
org.odlabs.wiquery.core.behavior.WiQueryAbstractAjaxBehavior
org.odlabs.wiquery.ui.droppable.DroppableAjaxBehavior<E>
E
- Type of component to findpublic abstract class DroppableAjaxBehavior<E extends org.apache.wicket.Component>
$Id$
Sets the attached component droppable, e.g. it can accept draggable elements. When the
drop is done, onDrop(Component, AjaxRequestTarget)
is called by an Ajax
request.
Contains a DroppableBehavior
which is used to control the options of the
droppable, including accept, activeClass, addClasses, greedy, hoverClass, scope, and
tolerance. For example:
DroppableAjaxBehavior droppable = new DroppableAjaxBehavior() { public void onDrop(Component droppedComponent, AjaxRequestTarget ajaxRequestTarget) { ... } }; DroppableBehavior dp = droppable.getDroppableBehavior(); dp.setAccept(new DroppableAccept(".fruit")); dp.setHoverClass("drophover"); dp.setScope("candy"); add(droppable);
Field Summary |
---|
Fields inherited from class org.apache.wicket.ajax.AbstractDefaultAjaxBehavior |
---|
INDICATOR |
Fields inherited from interface org.apache.wicket.behavior.IBehaviorListener |
---|
INTERFACE |
Constructor Summary | |
---|---|
DroppableAjaxBehavior()
Default constructor |
Method Summary | |
---|---|
JsStatement |
destroy()
Method to destroy the droppable This will return the element back to its pre-init state. |
void |
destroy(org.apache.wicket.ajax.AjaxRequestTarget ajaxRequestTarget)
Method to destroy the droppable within the ajax request |
JsStatement |
disable()
Method to disable the droppable |
void |
disable(org.apache.wicket.ajax.AjaxRequestTarget ajaxRequestTarget)
Method to disable the droppable within the ajax request |
JsStatement |
enable()
Method to enable the droppable |
void |
enable(org.apache.wicket.ajax.AjaxRequestTarget ajaxRequestTarget)
Method to enable the droppable within the ajax request |
DroppableAccept |
getAccept()
|
String |
getActiveClass()
|
protected CharSequence |
getCallbackScript()
We override super method to add droppedId parameter to the URL. |
DroppableBehavior |
getDroppableBehavior()
|
String |
getHoverClass()
|
String |
getScope()
|
DroppableBehavior.ToleranceEnum |
getTolerance()
|
boolean |
isAddClasses()
|
boolean |
isDisabled()
|
boolean |
isGreedy()
|
protected void |
onBind()
|
void |
onDrop(org.apache.wicket.ajax.AjaxRequestTarget target)
For framework internal use only. |
abstract void |
onDrop(E droppedComponent,
org.apache.wicket.ajax.AjaxRequestTarget ajaxRequestTarget)
onDrop is called back when the drop event has been fired. |
protected void |
respond(org.apache.wicket.ajax.AjaxRequestTarget target)
|
DroppableAjaxBehavior<E> |
setAccept(DroppableAccept accept)
All draggables that match the selector will be accepted. |
DroppableAjaxBehavior<E> |
setActiveClass(String activeClass)
If specified, the class will be added to the droppable while an acceptable draggable is being dragged. |
DroppableAjaxBehavior<E> |
setAddClasses(boolean addClasses)
If true, will prevent event propagation on nested droppables. |
DroppableAjaxBehavior<E> |
setDisabled(boolean disabled)
Disables (true) or enables (false) the droppable. |
DroppableAjaxBehavior<E> |
setGreedy(boolean greedy)
If true, will prevent event propagation on nested droppables. |
DroppableAjaxBehavior<E> |
setHoverClass(String hoverClass)
If specified, the class will be added to the droppable while an acceptable draggable is being hovered. |
DroppableAjaxBehavior<E> |
setScope(String scope)
Used to group sets of draggable and droppable items, in addition to droppable's accept option. |
DroppableAjaxBehavior<E> |
setTolerance(DroppableBehavior.ToleranceEnum tolerance)
Set's the mode to use for testing whether a draggable is 'over' a droppable. |
JsStatement |
statement()
Returns the main JsStatement used to create the plugin. |
JsStatement |
widget()
Method to returns the .ui-droppable element |
void |
widget(org.apache.wicket.ajax.AjaxRequestTarget ajaxRequestTarget)
Method to returns the .ui-droppable element within the ajax request |
Methods inherited from class org.apache.wicket.ajax.AbstractDefaultAjaxBehavior |
---|
findIndicatorId, generateCallbackScript, getAjaxCallDecorator, getChannel, getChannelName, getFailureScript, getPreconditionScript, getSuccessScript, onRequest, renderHead, throttleScript |
Methods inherited from class org.apache.wicket.behavior.AbstractAjaxBehavior |
---|
afterRender, bind, getCallbackUrl, getComponent, getStatelessHint, onComponentRendered, onComponentTag, onComponentTag |
Methods inherited from class org.apache.wicket.behavior.Behavior |
---|
beforeRender, canCallListenerInterface, canCallListenerInterface, detach, isEnabled, isTemporary, onConfigure, onEvent, onException, unbind |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DroppableAjaxBehavior()
Method Detail |
---|
protected CharSequence getCallbackScript()
getCallbackScript
in class org.apache.wicket.ajax.AbstractDefaultAjaxBehavior
AbstractAjaxBehavior.getCallbackUrl()
public DroppableBehavior getDroppableBehavior()
protected void onBind()
onBind
in class org.apache.wicket.ajax.AbstractDefaultAjaxBehavior
public final void onDrop(org.apache.wicket.ajax.AjaxRequestTarget target)
public abstract void onDrop(E droppedComponent, org.apache.wicket.ajax.AjaxRequestTarget ajaxRequestTarget)
droppedComponent
- the dropped Component
ajaxRequestTarget
- the Ajax targetprotected void respond(org.apache.wicket.ajax.AjaxRequestTarget target)
respond
in class org.apache.wicket.ajax.AbstractDefaultAjaxBehavior
public JsStatement statement()
IWiQueryPlugin
JsStatement
used to create the plugin.
statement
in interface IWiQueryPlugin
statement
in class WiQueryAbstractAjaxBehavior
JsStatement
corresponding to this component.public DroppableAjaxBehavior<E> setAccept(DroppableAccept accept)
accept
-
public DroppableAccept getAccept()
public DroppableAjaxBehavior<E> setActiveClass(String activeClass)
activeClass
-
public String getActiveClass()
public DroppableAjaxBehavior<E> setAddClasses(boolean addClasses)
addClasses
-
public boolean isAddClasses()
public DroppableAjaxBehavior<E> setDisabled(boolean disabled)
disabled
-
public boolean isDisabled()
public DroppableAjaxBehavior<E> setGreedy(boolean greedy)
greedy
-
public boolean isGreedy()
public DroppableAjaxBehavior<E> setHoverClass(String hoverClass)
hoverClass
-
public String getHoverClass()
public DroppableAjaxBehavior<E> setScope(String scope)
scope
-
public String getScope()
public DroppableAjaxBehavior<E> setTolerance(DroppableBehavior.ToleranceEnum tolerance)
tolerance
-
public DroppableBehavior.ToleranceEnum getTolerance()
public JsStatement destroy()
public void destroy(org.apache.wicket.ajax.AjaxRequestTarget ajaxRequestTarget)
ajaxRequestTarget
- public JsStatement disable()
public void disable(org.apache.wicket.ajax.AjaxRequestTarget ajaxRequestTarget)
ajaxRequestTarget
- public JsStatement enable()
public void enable(org.apache.wicket.ajax.AjaxRequestTarget ajaxRequestTarget)
ajaxRequestTarget
- public JsStatement widget()
public void widget(org.apache.wicket.ajax.AjaxRequestTarget ajaxRequestTarget)
ajaxRequestTarget
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |