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 aDraggable
that is related to another component (defined by its selector).
The common use case is to have the ability to drag multipleDraggable
object.
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 newDraggable
for the given selectorprotected abstract Draggable<?>
create(String id, String selector, String helper)
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.
-
-
-
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 newDraggable
for the given selector- Parameters:
id
- the markup idselector
- the related component's selector- Returns:
- the
Draggable
object
-
create
protected abstract Draggable<?> create(String id, String selector, String helper)
Creates the newDraggable
by 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
Draggable
object
-
-