Class AbstractDraggableFactory
- java.lang.Object
-
- com.googlecode.wicket.jquery.ui.interaction.draggable.AbstractDraggableFactory
-
- All Implemented Interfaces:
Serializable,org.apache.wicket.util.io.IClusterable
- Direct Known Subclasses:
SelectableDraggableFactory
public abstract class AbstractDraggableFactory extends Object implements org.apache.wicket.util.io.IClusterable
Provides the ability to create aDraggablethat is related to another component (defined by its selector).
The common use case is to have the ability to drag multipleDraggableobject.
To achieve this, the role of the jQuery helper is important (seegetHelper(String)implementation inSelectableDraggableFactory)- Author:
- Sebastien Briquet - sebfz1
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description AbstractDraggableFactory()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Draggable<?>create(String id, String selector)Creates the newDraggablefor the given selectorprotected abstract Draggable<?>create(String id, String selector, String helper)protected abstract StringgetHelper(String selector)Gets the helper that might be used by theDraggable.
The returned value is supplied to thecreate(String, String, String)method.
-
-
-
Method Detail
-
getHelper
protected abstract String getHelper(String selector)
Gets the helper that might be used by theDraggable.
The returned value is supplied to thecreate(String, String, String)method.- Parameters:
selector- the selector- Returns:
- the helper
-
create
public final Draggable<?> create(String id, String selector)
Creates the newDraggablefor the given selector- Parameters:
id- the markup idselector- the related component's selector- Returns:
- the
Draggableobject
-
create
protected abstract Draggable<?> create(String id, String selector, String helper)
Creates the newDraggableby using the selector and/or the helper.
A typical implementation is:
return new Draggable<String>(id) { protected void onConfigure(JQueryBehavior behavior) { super.onConfigure(behavior); behavior.setOption("helper", helper); } };- Parameters:
id- the markup idselector- the related component's selectorhelper- the jQuery helper- Returns:
- the
Draggableobject
-
-