public class SortableBehavior extends WiQueryAbstractBehavior
Wicket behabior to use the JQuery UI Sortable behavior
Example : Java code:
List values = Arrays.asList(
"Value 1",
"Value 2",
"Value 3",
"Value 4",
"Value 5");
ListView listView = new ListView("listView", values) { | Modifier and Type | Class and Description |
|---|---|
static class |
SortableBehavior.AxisEnum
Enumeration for the axis option
|
static class |
SortableBehavior.CursorAtEnum
Enumeration for the cursorAt option
|
static class |
SortableBehavior.ToleranceEnum
Enumeration for the tolerance option
|
| Modifier and Type | Field and Description |
|---|---|
static String |
UI_HELPER
Properties on the ui parameter (use it into callback functions) : The
current helper element (most often a clone of the item)
|
static String |
UI_ITEM
Properties on the ui parameter (use it into callback functions) : The
current dragged element
|
static String |
UI_OFFSET
Properties on the ui parameter (use it into callback functions) : The
current absolute position of the helper
|
static String |
UI_PLACEHOLDER
Properties on the ui parameter (use it into callback functions) : The
placeholder (if you defined one)
|
static String |
UI_POSITION
Properties on the ui parameter (use it into callback functions) : The
current position of the helper
|
static String |
UI_SENDER
Properties on the ui parameter (use it into callback functions) : The
sortable where the item comes from
(only exists if you move from one connected list to another)
|
| Constructor and Description |
|---|
SortableBehavior()
Default constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
bind(org.apache.wicket.Component component) |
JsStatement |
cancel()
Method to cancel
This will return the element back to its pre-init state.
|
void |
cancel(org.apache.wicket.ajax.AjaxRequestTarget ajaxRequestTarget)
Method to cancel within the ajax request
|
void |
contribute(WiQueryResourceManager wiQueryResourceManager)
Declares resources (JavaScript and CSS files) to import.
|
JsStatement |
destroy()
Method to destroy
This will return the element back to its pre-init state.
|
void |
destroy(org.apache.wicket.ajax.AjaxRequestTarget ajaxRequestTarget)
Method to destroy within the ajax request
|
void |
detach(org.apache.wicket.Component component) |
JsStatement |
disable()
Method to disable
|
void |
disable(org.apache.wicket.ajax.AjaxRequestTarget ajaxRequestTarget)
Method to disable within the ajax request
|
JsStatement |
enable()
Method to enable
|
void |
enable(org.apache.wicket.ajax.AjaxRequestTarget ajaxRequestTarget)
Method to enable within the ajax request
|
String |
getAppendTo() |
SortableBehavior.AxisEnum |
getAxis() |
String |
getCancel() |
String |
getConnectWith() |
String |
getContainment()
Deprecated.
will be changed in 1.2 to return a
SortableContainment |
SortableContainment |
getContainmentComplex() |
String |
getCursor() |
SortableBehavior.CursorAtEnum |
getCursorAt() |
int |
getDelay() |
int |
getDistance() |
boolean |
getDropOnEmpty()
Deprecated.
will be removed in 1.2
|
boolean |
getForceHelperSize()
Deprecated.
will be removed in 1.2
|
boolean |
getForcePlaceholderSize()
Deprecated.
will be removed in 1.2
|
ICollectionItemOptions |
getGrid() |
String |
getHandle() |
String |
getHelper()
Deprecated.
will be changed in 1.2 to return a
SortableHelper |
SortableHelper |
getHelperComplex() |
String |
getItems() |
float |
getOpacity() |
protected Options |
getOptions()
Method retrieving the options of the component
|
String |
getPlaceHolder() |
SortableRevert |
getRevert() |
int |
getScrollSensitivity() |
int |
getScrollSpeed() |
SortableBehavior.ToleranceEnum |
getTolerance() |
int |
getZIndex() |
boolean |
isDisabled() |
boolean |
isDropOnEmpty() |
boolean |
isForceHelperSize() |
boolean |
isForcePlaceholderSize() |
boolean |
isRevert()
Deprecated.
will be changed in 1.2 to return a
SortableRevert |
boolean |
isScroll() |
JsStatement |
refresh()
Method to refresh
|
void |
refresh(org.apache.wicket.ajax.AjaxRequestTarget ajaxRequestTarget)
Method to refresh within the ajax request
|
JsStatement |
refreshPositions()
Method to refresh positions
|
void |
refreshPositions(org.apache.wicket.ajax.AjaxRequestTarget ajaxRequestTarget)
Method to refresh positions within the ajax request
|
JsStatement |
serialize()
Method to serialize (in default mode)
|
void |
serialize(org.apache.wicket.ajax.AjaxRequestTarget ajaxRequestTarget)
Method to serialize (in default mode) within the ajax request
|
SortableBehavior |
setActivateEvent(JsScopeUiEvent activate)
Set's the callback when using connected lists, every connected list on
drag start receives it.
|
SortableBehavior |
setAppendTo(String appendTo)
Defines where the helper that moves with the mouse is being appended to
during the drag (for example, to resolve overlap/zIndex issues).
|
SortableBehavior |
setAxis(SortableBehavior.AxisEnum axis)
If defined, the items can be dragged only horizontally or vertically.
|
SortableBehavior |
setBeforeStopEvent(JsScopeUiEvent beforeStop)
Set's the callback when sorting stops, but when the placeholder/helper is
still available.
|
SortableBehavior |
setCancel(String cancel)
Set's the prevent selecting if you start on elements matching the selector
|
SortableBehavior |
setChangeEvent(JsScopeUiEvent change)
Set's the callback during sorting, but only when the DOM position has changed.
|
SortableBehavior |
setConnectWith(String connectWith)
Set a jQuery selector with items that also have sortables applied.
|
SortableBehavior |
setContainment(SortableContainment containment)
Constrains dragging to within the bounds of the specified element -
can be a DOM element, 'parent', 'document', 'window', or a jQuery selector.
|
SortableBehavior |
setContainment(String containment)
Deprecated.
will be removed in 1.2
|
SortableBehavior |
setCursor(String cursor)
Set the cursor that is being shown while sorting
|
SortableBehavior |
setCursorAt(SortableBehavior.CursorAtEnum cusorAt)
Moves the sorting element or helper so the cursor always appears to drag
from the same position.
|
SortableBehavior |
setDeactivateEvent(JsScopeUiEvent deactivate)
Set's the callback when sorting was stopped, is propagated to all possible
connected lists.
|
SortableBehavior |
setDelay(int delay)
Set's the delay (in milliseconds) to define when the sorting should start
|
SortableBehavior |
setDisabled(boolean disabled)
Disables (true) or enables (false) the sortable.
|
SortableBehavior |
setDistance(int distance)
Set's the tolerance in pixels
|
SortableBehavior |
setDropOnEmpty(boolean dropOnEmpty)
If empty allows for an item to be dropped from a linked selectable.
|
SortableBehavior |
setForceHelperSize(boolean forceHelperSize)
If true, forces the helper to have a size.
|
SortableBehavior |
setForcePlaceholderSize(boolean forcePlaceholderSize)
If true, forces the placeholder to have a size.
|
SortableBehavior |
setGrid(int x,
int y)
Snaps the sorting element or helper to a grid, every x and y pixels.
|
SortableBehavior |
setHandle(String handle)
Restricts sort start click to the specified element.
|
SortableBehavior |
setHelper(SortableHelper helper)
Allows for a helper element to be used for dragging display.
|
SortableBehavior |
setHelper(String helper)
Deprecated.
will be removed in 1.2
|
SortableBehavior |
setItems(String items)
Specifies which items inside the element should be sortable.
|
SortableBehavior |
setOpacity(float opacity)
Set the opacity of the helper while sorting.
|
SortableBehavior |
setOutEvent(JsScopeUiEvent out)
Set's the callback when a sortable item is moved away from a connected list.
|
SortableBehavior |
setOverEvent(JsScopeUiEvent over)
Set's the callback when a sortable item is moved into a connected list.
|
SortableBehavior |
setPlaceholder(String placeholder)
Set's the class that gets applied to the otherwise white space.
|
SortableBehavior |
setReceiveEvent(JsScopeUiEvent receive)
Set's the callback when a connected sortable list has received an item
from another list.
|
SortableBehavior |
setRemoveEvent(JsScopeUiEvent remove)
Set's the callback when a sortable item has been dragged out from the
list and into another.
|
SortableBehavior |
setRevert(boolean revert)
Deprecated.
will be removed in 1.2
|
SortableBehavior |
setRevert(SortableRevert revert)
If set to true, the item will be reverted to its new DOM position with
a smooth animation.
|
SortableBehavior |
setScroll(boolean scroll)
If set to true, the page scrolls when coming to an edge.
|
SortableBehavior |
setScrollSensitivity(int scrollSensitivity)
Defines how near the mouse must be to an edge to start scrolling.
|
SortableBehavior |
setScrollSpeed(int scrollSpeed)
The speed at which the window should scroll once the mouse pointer gets
within the scrollSensitivity distance.
|
SortableBehavior |
setSortEvent(JsScopeUiEvent sort)
Set's the callback during sorting
|
SortableBehavior |
setStartEvent(JsScopeUiEvent start)
Set's the callback when sorting starts
|
SortableBehavior |
setStopEvent(JsScopeUiEvent stop)
Set's the callback when sorting has stopped.
|
SortableBehavior |
setTolerance(SortableBehavior.ToleranceEnum tolerance)
Set's the tolerance
intersect: draggable overlaps the droppable at least 50%
pointer: mouse pointer overlaps the droppable
|
SortableBehavior |
setUpdateEvent(JsScopeUiEvent update)
Set's the callback when the user stopped sorting and the DOM position has changed.
|
SortableBehavior |
setZIndex(int zIndex)
Set's Z-index for element/helper while being sorted.
|
JsStatement |
statement()
Returns the main
JsStatement used to create the plugin. |
JsStatement |
toArray()
Method to serializes the sortable's item id's into an array of string
|
JsStatement |
widget()
Method to returns the .ui-sortable element
|
void |
widget(org.apache.wicket.ajax.AjaxRequestTarget ajaxRequestTarget)
Method to returns the .ui-sortable element within the ajax request
|
getComponentpublic static final String UI_HELPER
public static final String UI_POSITION
public static final String UI_OFFSET
public static final String UI_ITEM
public static final String UI_PLACEHOLDER
public static final String UI_SENDER
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()public String getAppendTo()
public SortableBehavior.AxisEnum getAxis()
public String getCancel()
public String getConnectWith()
@Deprecated public String getContainment()
SortableContainmentpublic SortableContainment getContainmentComplex()
public String getCursor()
public SortableBehavior.CursorAtEnum getCursorAt()
public int getDelay()
public int getDistance()
@Deprecated public boolean getDropOnEmpty()
@Deprecated public boolean getForceHelperSize()
@Deprecated public boolean getForcePlaceholderSize()
public ICollectionItemOptions getGrid()
public String getHandle()
@Deprecated public String getHelper()
SortableHelperpublic SortableHelper getHelperComplex()
public String getItems()
public float getOpacity()
protected Options getOptions()
public String getPlaceHolder()
public SortableRevert getRevert()
public int getScrollSensitivity()
public int getScrollSpeed()
public SortableBehavior.ToleranceEnum getTolerance()
public int getZIndex()
public SortableBehavior setDisabled(boolean disabled)
disabled - public boolean isDisabled()
public boolean isDropOnEmpty()
public boolean isForceHelperSize()
public boolean isForcePlaceholderSize()
@Deprecated public boolean isRevert()
SortableRevertpublic boolean isScroll()
public SortableBehavior setAppendTo(String appendTo)
appendTo - public SortableBehavior setAxis(SortableBehavior.AxisEnum axis)
axis - public SortableBehavior setCancel(String cancel)
cancel - Selector (default : ':input,option')public SortableBehavior setConnectWith(String connectWith)
connectWith - Selector@Deprecated public SortableBehavior setContainment(String containment)
containment - public SortableBehavior setContainment(SortableContainment containment)
containment - public SortableBehavior setCursor(String cursor)
cursor - public SortableBehavior setCursorAt(SortableBehavior.CursorAtEnum cusorAt)
cusorAt - public SortableBehavior setDelay(int delay)
delay - public SortableBehavior setDistance(int distance)
distance - public SortableBehavior setDropOnEmpty(boolean dropOnEmpty)
dropOnEmpty - public SortableBehavior setForceHelperSize(boolean forceHelperSize)
forceHelperSize - public SortableBehavior setForcePlaceholderSize(boolean forcePlaceholderSize)
forcePlaceholderSize - public SortableBehavior setGrid(int x, int y)
x - y - public SortableBehavior setHandle(String handle)
handle - @Deprecated public SortableBehavior setHelper(String helper)
helper - public SortableBehavior setHelper(SortableHelper helper)
helper - public SortableBehavior setItems(String items)
items - Cursor (default : '> *')public SortableBehavior setOpacity(float opacity)
opacity - public SortableBehavior setPlaceholder(String placeholder)
placeholder - @Deprecated public SortableBehavior setRevert(boolean revert)
revert - public SortableBehavior setRevert(SortableRevert revert)
revert - public SortableBehavior setScroll(boolean scroll)
scroll - public SortableBehavior setScrollSensitivity(int scrollSensitivity)
scrollSensitivity - public SortableBehavior setScrollSpeed(int scrollSpeed)
scrollSpeed - public SortableBehavior setTolerance(SortableBehavior.ToleranceEnum tolerance)
tolerance - public SortableBehavior setZIndex(int zIndex)
zIndex - public SortableBehavior setActivateEvent(JsScopeUiEvent activate)
activate - public SortableBehavior setBeforeStopEvent(JsScopeUiEvent beforeStop)
beforeStop - public SortableBehavior setChangeEvent(JsScopeUiEvent change)
change - public SortableBehavior setDeactivateEvent(JsScopeUiEvent deactivate)
deactivate - public SortableBehavior setOutEvent(JsScopeUiEvent out)
out - public SortableBehavior setOverEvent(JsScopeUiEvent over)
over - public SortableBehavior setReceiveEvent(JsScopeUiEvent receive)
receive - public SortableBehavior setRemoveEvent(JsScopeUiEvent remove)
remove - public SortableBehavior setSortEvent(JsScopeUiEvent sort)
sort - public SortableBehavior setStartEvent(JsScopeUiEvent start)
start - public SortableBehavior setStopEvent(JsScopeUiEvent stop)
stop - public SortableBehavior setUpdateEvent(JsScopeUiEvent update)
update - public JsStatement cancel()
public void cancel(org.apache.wicket.ajax.AjaxRequestTarget ajaxRequestTarget)
ajaxRequestTarget - 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 refresh()
public void refresh(org.apache.wicket.ajax.AjaxRequestTarget ajaxRequestTarget)
ajaxRequestTarget - public JsStatement refreshPositions()
public void refreshPositions(org.apache.wicket.ajax.AjaxRequestTarget ajaxRequestTarget)
ajaxRequestTarget - public JsStatement serialize()
public void serialize(org.apache.wicket.ajax.AjaxRequestTarget ajaxRequestTarget)
ajaxRequestTarget - public JsStatement toArray()
public JsStatement widget()
public void widget(org.apache.wicket.ajax.AjaxRequestTarget ajaxRequestTarget)
ajaxRequestTarget - Copyright © 2009-2012. All Rights Reserved.