public class DroppableBehavior extends WiQueryAbstractBehavior
Sets the attached component droppable, e.g. it can accept draggable elements.
| Modifier and Type | Class and Description |
|---|---|
static class |
DroppableBehavior.ToleranceEnum
Enumeration for the tolerance option
|
| Modifier and Type | Field and Description |
|---|---|
static String |
UI_DRAGGABLE
Properties on the ui parameter (use it into callback functions) : current
draggable element, a jQuery object.
|
static String |
UI_HELPER
Properties on the ui parameter (use it into callback functions) : current
draggable helper, a jQuery object
|
static String |
UI_OFFSET
Properties on the ui parameter (use it into callback functions) : current
absolute position of the draggable helper { top: , left: }
|
static String |
UI_POSITION
Properties on the ui parameter (use it into callback functions) : current
position of the draggable helper { top: , left: }
|
| Constructor and Description |
|---|
DroppableBehavior() |
| Modifier and Type | Method and Description |
|---|---|
void |
bind(org.apache.wicket.Component component) |
void |
contribute(WiQueryResourceManager wiQueryResourceManager)
Declares resources (JavaScript and CSS files) to import.
|
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
|
void |
detach(org.apache.wicket.Component component) |
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() |
String |
getHoverClass() |
protected Options |
getOptions()
Method retrieving the options of the component
|
String |
getScope() |
DroppableBehavior.ToleranceEnum |
getTolerance() |
boolean |
isAddClasses() |
boolean |
isDisabled() |
boolean |
isGreedy() |
DroppableBehavior |
setAccept(DroppableAccept accept)
All draggables that match the selector will be accepted.
|
DroppableBehavior |
setActivateEvent(JsScopeUiEvent activate)
Set's the callback when an accepted draggable starts dragging.
|
DroppableBehavior |
setActiveClass(String activeClass)
If specified, the class will be added to the droppable while an
acceptable draggable is being dragged.
|
DroppableBehavior |
setAddClasses(boolean addClasses)
If true, will prevent event propagation on nested droppables.
|
DroppableBehavior |
setDeactivateEvent(JsScopeUiEvent deactivate)
Set's the callback when an accepted draggable stops dragging.
|
DroppableBehavior |
setDisabled(boolean disabled)
Disables (true) or enables (false) the droppable.
|
DroppableBehavior |
setDropEvent(JsScopeUiEvent drop)
Set's the callback when an accepted draggable is dropped 'over' (within
the tolerance of) this droppable.
|
DroppableBehavior |
setGreedy(boolean greedy)
If true, will prevent event propagation on nested droppables.
|
DroppableBehavior |
setHoverClass(String hoverClass)
If specified, the class will be added to the droppable while an
acceptable draggable is being hovered.
|
DroppableBehavior |
setOutEvent(JsScopeUiEvent out)
Set's the callback when an accepted draggable is dragged out (within the
tolerance of) this droppable.
|
DroppableBehavior |
setOverEvent(JsScopeUiEvent over)
Set's the callback when an accepted draggable is dragged 'over' (within
the tolerance of) this droppable.
|
DroppableBehavior |
setScope(String scope)
Used to group sets of draggable and droppable items, in addition to
droppable's accept option.
|
DroppableBehavior |
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
|
getComponentpublic static final String UI_DRAGGABLE
public static final String UI_HELPER
public static final String UI_POSITION
public static final String UI_OFFSET
public void bind(org.apache.wicket.Component component)
bind in interface org.apache.wicket.behavior.IBehaviorbind in class WiQueryAbstractBehaviorpublic void detach(org.apache.wicket.Component component)
detach in interface org.apache.wicket.behavior.IBehaviordetach in class org.apache.wicket.behavior.AbstractBehaviorpublic void contribute(WiQueryResourceManager wiQueryResourceManager)
contribute in interface IWiQueryPlugincontribute in class WiQueryAbstractBehaviorwiQueryResourceManager - The WiQueryResourceManager instance managing this
component resources.WiQueryAbstractBehavior.contribute(org.odlabs.wiquery.core.commons.WiQueryResourceManager)public JsStatement statement()
JsStatement used to create the plugin.statement in interface IWiQueryPluginstatement in class WiQueryAbstractBehaviorJsStatement corresponding to this component.WiQueryAbstractBehavior.statement()protected Options getOptions()
public DroppableBehavior setAccept(DroppableAccept accept)
accept - public DroppableAccept getAccept()
public DroppableBehavior setActiveClass(String activeClass)
activeClass - public String getActiveClass()
public DroppableBehavior setAddClasses(boolean addClasses)
addClasses - public boolean isAddClasses()
public DroppableBehavior setDisabled(boolean disabled)
disabled - public boolean isDisabled()
public DroppableBehavior setGreedy(boolean greedy)
greedy - public boolean isGreedy()
public DroppableBehavior setHoverClass(String hoverClass)
hoverClass - public String getHoverClass()
public DroppableBehavior setScope(String scope)
scope - public String getScope()
public DroppableBehavior setTolerance(DroppableBehavior.ToleranceEnum tolerance)
tolerance - public DroppableBehavior.ToleranceEnum getTolerance()
public DroppableBehavior setActivateEvent(JsScopeUiEvent activate)
activate - public DroppableBehavior setDeactivateEvent(JsScopeUiEvent deactivate)
deactivate - public DroppableBehavior setDropEvent(JsScopeUiEvent drop)
drop - public DroppableBehavior setOutEvent(JsScopeUiEvent out)
out - public DroppableBehavior setOverEvent(JsScopeUiEvent over)
over - 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 - Copyright © 2009-2012. All Rights Reserved.