com.googlecode.wicket.jquery.ui.form.slider
Class AbstractSlider<T>

java.lang.Object
  extended by org.apache.wicket.Component
      extended by org.apache.wicket.MarkupContainer
          extended by org.apache.wicket.markup.html.WebMarkupContainer
              extended by org.apache.wicket.markup.html.form.LabeledWebMarkupContainer
                  extended by org.apache.wicket.markup.html.form.FormComponent<T>
                      extended by org.apache.wicket.markup.html.form.FormComponentPanel<T>
                          extended by com.googlecode.wicket.jquery.ui.form.slider.AbstractSlider<T>
Type Parameters:
T - the model object type
All Implemented Interfaces:
IJQueryWidget, Serializable, Iterable<org.apache.wicket.Component>, org.apache.wicket.event.IEventSink, org.apache.wicket.event.IEventSource, org.apache.wicket.IConverterLocator, org.apache.wicket.IGenericComponent<T>, org.apache.wicket.markup.html.form.IFormModelUpdateListener, org.apache.wicket.markup.html.form.IFormVisitorParticipant, org.apache.wicket.markup.html.form.ILabelProvider<String>, org.apache.wicket.markup.html.IHeaderContributor, org.apache.wicket.request.component.IRequestableComponent, org.apache.wicket.util.IHierarchical<org.apache.wicket.Component>, org.apache.wicket.util.io.IClusterable
Direct Known Subclasses:
RangeSlider, Slider

public abstract class AbstractSlider<T>
extends org.apache.wicket.markup.html.form.FormComponentPanel<T>
implements IJQueryWidget

Base class for implementing jQuery slider(s)

Author:
Sebastien Briquet - sebfz1
See Also:
Serialized Form

Nested Class Summary
static class AbstractSlider.SliderBehavior
          Provides a jQuery slider JQueryBehavior
 
Nested classes/interfaces inherited from interface com.googlecode.wicket.jquery.core.IJQueryWidget
IJQueryWidget.JQueryWidget
 
Field Summary
protected  org.apache.wicket.markup.html.basic.Label label
           
protected  String labelId
           
protected  Options options
           
 
Fields inherited from class org.apache.wicket.markup.html.form.FormComponent
FLAG_CONVERT_EMPTY_INPUT_STRING_TO_NULL, VALUE_SEPARATOR
 
Fields inherited from class org.apache.wicket.Component
ENABLE, FLAG_INITIALIZED, FLAG_REMOVING_FROM_HIERARCHY, FLAG_RESERVED1, FLAG_RESERVED2, FLAG_RESERVED3, FLAG_RESERVED4, FLAG_RESERVED5, FLAG_RESERVED8, PARENT_PATH, PATH_SEPARATOR, RENDER
 
Constructor Summary
AbstractSlider(String id)
          Constructor
AbstractSlider(String id, org.apache.wicket.model.IModel<T> model)
          Constructor
AbstractSlider(String id, org.apache.wicket.model.IModel<T> model, org.apache.wicket.markup.html.basic.Label label)
          Constructor
 
Method Summary
protected abstract  void convertInput()
           
protected  void init()
          Initialization, should be called manually by overridden classes, in their constructors.
Warning: Options should not be set before this method has been called.
protected  org.apache.wicket.markup.html.panel.Fragment newInputFragment(String id)
          Gets a new Fragment containing the input
Overridden methods should provide a Fragment containing input(s) when no input(s) has been specified in implementation constructors.
 JQueryBehavior newWidgetBehavior(String selector)
           
protected  void onConfigure(JQueryBehavior behavior)
          Called immediately after the onConfigure method in a behavior.
protected  void onInitialize()
           
 AbstractSlider<T> setLabelId(String markupId)
          Sets the label's markupId on which the current slide value will be displayed.
Warning: It cannot be set/changed once the Component has been initialized.
<W extends AbstractSlider<T>>
W
setMax(Integer max)
          Sets the max value
<W extends AbstractSlider<T>>
W
setMin(Integer min)
          Sets the min value
<W extends AbstractSlider<T>>
W
setOrientation(Orientation orientation)
          Sets the Orientation
abstract
<W extends AbstractSlider<T>>
W
setRangeValidator(org.apache.wicket.validation.validator.RangeValidator<Integer> validator)
          Adds a RangeValidator so slider value(s) are valid only if comprised between minimum and maximum.

Warning: it does not define the minimum and maximum values the slider can slide on, but only valid ones.
To define the minimum and maximum values the slider can slide on, use setMin(Integer) and setMax(Integer)

Dev note: this method is masked abstract to make sure the developer that will add the validator to the right input(s) in onInitialize()
<W extends AbstractSlider<T>>
W
setStep(Integer step)
          Sets the step value
 
Methods inherited from class org.apache.wicket.markup.html.form.FormComponentPanel
checkRequired, newMarkupSourcingStrategy, onComponentTag
 
Methods inherited from class org.apache.wicket.markup.html.form.FormComponent
add, add, clearInput, convertValue, error, getConvertedInput, getDefaultLabel, getDefaultLabel, getForm, getInput, getInputAsArray, getInputName, getModel, getModelObject, getModelValue, getRawInput, getType, getValidatorKeyPrefix, getValidators, getValue, hasRawInput, inputAsInt, inputAsInt, inputAsIntArray, inputChanged, internalOnModelChanged, invalid, isInputNullable, isMultiPart, isRequired, isValid, newValidatable, newValidationError, onDetach, onDisabled, onInvalid, onValid, processChildren, processInput, remove, reportRequiredError, setConvertedInput, setLabel, setModel, setModelObject, setModelValue, setRequired, setType, shouldTrimInput, trim, updateCollectionModel, updateModel, valid, validate, validateRequired, validateValidators, visitComponentsPostOrder, visitFormComponentsPostOrder
 
Methods inherited from class org.apache.wicket.markup.html.form.LabeledWebMarkupContainer
getLabel
 
Methods inherited from class org.apache.wicket.markup.html.WebMarkupContainer
getWebPage, getWebRequest, getWebResponse, getWebSession
 
Methods inherited from class org.apache.wicket.MarkupContainer
add, addOrReplace, autoAdd, contains, get, get, getAssociatedMarkup, getAssociatedMarkupStream, getMarkup, getMarkupType, internalAdd, internalInitialize, iterator, iterator, onAfterRenderChildren, onComponentTagBody, onRender, remove, remove, removeAll, renderAll, renderAssociatedMarkup, renderNext, replace, setDefaultModel, size, swap, toString, toString, visitChildren, visitChildren, visitChildren, visitChildren
 
Methods inherited from class org.apache.wicket.Component
add, addStateChange, afterRender, beforeRender, canCallListenerInterface, checkComponentTag, checkComponentTagAttribute, checkHierarchyChange, configure, continueToOriginalDestination, debug, detach, detachModel, detachModels, determineVisibility, error, exceptionMessage, fatal, findMarkupStream, findPage, findParent, findParentWithAssociatedMarkup, getAjaxRegionMarkupId, getApplication, getBehaviorById, getBehaviorId, getBehaviors, getBehaviors, getClassRelativePath, getConverter, getDefaultModel, getDefaultModelObject, getDefaultModelObjectAsString, getDefaultModelObjectAsString, getEscapeModelStrings, getFeedbackMessages, getFlag, getId, getInnermostModel, getInnermostModel, getLocale, getLocalizer, getMarkup, getMarkupAttributes, getMarkupId, getMarkupId, getMarkupIdFromMarkup, getMarkupIdImpl, getMarkupSourcingStrategy, getMetaData, getModelComparator, getOutputMarkupId, getOutputMarkupPlaceholderTag, getPage, getPageRelativePath, getParent, getPath, getRenderBodyOnly, getRequest, getRequestCycle, getRequestFlag, getResponse, getSession, getSizeInBytes, getStatelessHint, getString, getString, getString, getStyle, getVariation, hasBeenRendered, hasErrorMessage, hasFeedbackMessage, info, initModel, internalPrepareForRender, internalRenderComponent, isActionAuthorized, isAuto, isBehaviorAccepted, isEnableAllowed, isEnabled, isEnabledInHierarchy, isIgnoreAttributeModifier, isRenderAllowed, isStateless, isVersioned, isVisibilityAllowed, isVisible, isVisibleInHierarchy, markRendering, modelChanged, modelChanging, onAfterRender, onBeforeRender, onConfigure, onEvent, onModelChanged, onModelChanging, onRemove, prepareForRender, redirectToInterceptPage, remove, remove, render, renderComponentTag, rendered, renderHead, renderHead, renderHead, renderPlaceholderTag, replaceComponentTagBody, replaceWith, sameInnermostModel, sameInnermostModel, send, setAuto, setDefaultModelObject, setEnabled, setEscapeModelStrings, setFlag, setIgnoreAttributeModifier, setMarkup, setMarkupId, setMarkupIdImpl, setMetaData, setOutputMarkupId, setOutputMarkupPlaceholderTag, setParent, setRenderBodyOnly, setRequestFlag, setResponsePage, setResponsePage, setResponsePage, setVersioned, setVisibilityAllowed, setVisible, success, urlFor, urlFor, urlFor, urlFor, urlFor, visitParents, visitParents, warn, wrap
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

options

protected Options options

label

protected org.apache.wicket.markup.html.basic.Label label

labelId

protected String labelId
Constructor Detail

AbstractSlider

public AbstractSlider(String id)
Constructor

Parameters:
id - the markup id

AbstractSlider

public AbstractSlider(String id,
                      org.apache.wicket.model.IModel<T> model)
Constructor

Parameters:
id - the markup id
model - the IModel

AbstractSlider

public AbstractSlider(String id,
                      org.apache.wicket.model.IModel<T> model,
                      org.apache.wicket.markup.html.basic.Label label)
Constructor

Parameters:
id - the markup id
model - the IModel
label - Label on which the current slide value will be displayed
Method Detail

init

protected void init()
Initialization, should be called manually by overridden classes, in their constructors.
Warning: Options should not be set before this method has been called.


convertInput

protected abstract void convertInput()
Overrides:
convertInput in class org.apache.wicket.markup.html.form.FormComponent<T>

setRangeValidator

public abstract <W extends AbstractSlider<T>> W setRangeValidator(org.apache.wicket.validation.validator.RangeValidator<Integer> validator)
Adds a RangeValidator so slider value(s) are valid only if comprised between minimum and maximum.

Warning: it does not define the minimum and maximum values the slider can slide on, but only valid ones.
To define the minimum and maximum values the slider can slide on, use setMin(Integer) and setMax(Integer)

Dev note: this method is masked abstract to make sure the developer that will add the validator to the right input(s) in onInitialize()

Type Parameters:
W - the widget type
Parameters:
validator - the RangeValidator
Returns:
this

setLabelId

public AbstractSlider<T> setLabelId(String markupId)
Sets the label's markupId on which the current slide value will be displayed.
Warning: It cannot be set/changed once the Component has been initialized.

Parameters:
markupId - the label's markupId
Returns:
this

onInitialize

protected void onInitialize()
Overrides:
onInitialize in class org.apache.wicket.Component

onConfigure

protected void onConfigure(JQueryBehavior behavior)
Called immediately after the onConfigure method in a behavior. Since this is before the rendering cycle has begun, the behavior can modify the configuration of the component (i.e. Options)

Parameters:
behavior - the JQueryBehavior

newWidgetBehavior

public JQueryBehavior newWidgetBehavior(String selector)
Specified by:
newWidgetBehavior in interface IJQueryWidget

newInputFragment

protected org.apache.wicket.markup.html.panel.Fragment newInputFragment(String id)
Gets a new Fragment containing the input
Overridden methods should provide a Fragment containing input(s) when no input(s) has been specified in implementation constructors.

Returns:
the empty-fragment by default

setMin

public <W extends AbstractSlider<T>> W setMin(Integer min)
Sets the min value

Type Parameters:
W - the widget type
Parameters:
min -
Returns:
this

setMax

public <W extends AbstractSlider<T>> W setMax(Integer max)
Sets the max value

Type Parameters:
W - the widget type
Parameters:
max -
Returns:
this

setStep

public <W extends AbstractSlider<T>> W setStep(Integer step)
Sets the step value

Type Parameters:
W - the widget type
Parameters:
step -
Returns:
this

setOrientation

public <W extends AbstractSlider<T>> W setOrientation(Orientation orientation)
Sets the Orientation

Type Parameters:
W - the widget type
Parameters:
orientation -
Returns:
this


Copyright © 2013 7thWeb. All Rights Reserved.