|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.wicket.Component
org.apache.wicket.MarkupContainer
org.apache.wicket.markup.html.WebMarkupContainer
org.apache.wicket.markup.html.form.LabeledWebMarkupContainer
org.apache.wicket.markup.html.form.FormComponent<T>
org.apache.wicket.markup.html.form.AbstractChoice<T,E>
T
- The model object typeE
- class of a single element in the choices listpublic abstract class AbstractChoice<T,E>
Abstract base class for all choice (html select) options.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.apache.wicket.markup.html.form.FormComponent |
---|
FormComponent.AbstractVisitor, FormComponent.IVisitor |
Nested classes/interfaces inherited from class org.apache.wicket.Component |
---|
Component.ComponentModelChange, Component.EnabledChange, Component.VisibilityChange |
Field Summary |
---|
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_CONFIGURED, FLAG_INITIALIZED, FLAG_REMOVING_FROM_HIERARCHY, FLAG_RESERVED1, FLAG_RESERVED2, FLAG_RESERVED3, FLAG_RESERVED4, FLAG_RESERVED5, FLAG_RESERVED6, FLAG_RESERVED7, FLAG_RESERVED8, PARENT_PATH, PATH_SEPARATOR, RENDER |
Constructor Summary | |
---|---|
AbstractChoice(String id)
Constructor. |
|
AbstractChoice(String id,
IModel<? extends List<? extends E>> choices)
Constructor. |
|
AbstractChoice(String id,
IModel<? extends List<? extends E>> choices,
IChoiceRenderer<? super E> renderer)
Constructor. |
|
AbstractChoice(String id,
IModel<T> model,
IModel<? extends List<? extends E>> choices)
Constructor. |
|
AbstractChoice(String id,
IModel<T> model,
IModel<? extends List<? extends E>> choices,
IChoiceRenderer<? super E> renderer)
Constructor. |
|
AbstractChoice(String id,
IModel<T> model,
List<? extends E> choices)
Constructor. |
|
AbstractChoice(String id,
IModel<T> model,
List<? extends E> choices,
IChoiceRenderer<? super E> renderer)
Constructor. |
|
AbstractChoice(String id,
List<? extends E> choices)
Constructor. |
|
AbstractChoice(String id,
List<? extends E> choices,
IChoiceRenderer<? super E> renderer)
Constructor. |
Method Summary | |
---|---|
protected void |
appendOptionHtml(AppendingStringBuffer buffer,
E choice,
int index,
String selected)
Generates and appends html for a single choice into the provided buffer |
protected void |
detachModel()
Detaches the model for this component if it is detachable. |
protected CharSequence |
escapeOptionHtml(String displayValue)
Method to override if you want special escaping of the options html. |
IChoiceRenderer<? super E> |
getChoiceRenderer()
|
List<? extends E> |
getChoices()
|
protected CharSequence |
getDefaultChoice(Object selected)
|
protected boolean |
isDisabled(E object,
int index,
String selected)
Gets whether the given value is disabled. |
protected abstract boolean |
isSelected(E object,
int index,
String selected)
Gets whether the given value represents the current selection. |
protected boolean |
localizeDisplayValues()
Override this method if you want to localize the display values of the generated options. |
protected void |
onComponentTagBody(MarkupStream markupStream,
ComponentTag openTag)
Handle the container's body. |
AbstractChoice<T,E> |
setChoiceRenderer(IChoiceRenderer<? super E> renderer)
Set the choice renderer to be used. |
AbstractChoice<T,E> |
setChoices(IModel<? extends List<? extends E>> choices)
Sets the list of choices |
AbstractChoice<T,E> |
setChoices(List<E> choices)
Sets the list of choices. |
protected boolean |
supportsPersistence()
|
Methods inherited from class org.apache.wicket.markup.html.form.FormComponent |
---|
add, add, checkRequired, clearInput, convertInput, 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, isPersistent, isRequired, isValid, newValidatable, onComponentTag, onDetach, onDisabled, onInvalid, onValid, processChildren, processInput, setConvertedInput, setLabel, setModel, setModelObject, setModelValue, setModelValue, setPersistent, setRequired, setType, shouldTrimInput, trim, updateModel, valid, validate, validateRequired, validateValidators, visitComponentsPostOrder, visitFormComponentsPostOrder |
Methods inherited from class org.apache.wicket.markup.html.form.LabeledWebMarkupContainer |
---|
getLabel, setLabelInternal |
Methods inherited from class org.apache.wicket.markup.html.WebMarkupContainer |
---|
getMarkupType, getWebPage, getWebRequest |
Methods inherited from class org.apache.wicket.MarkupContainer |
---|
add, addOrReplace, autoAdd, autoAdd, contains, findMarkupStream, get, get, getAssociatedMarkupStream, getMarkupStream, hasAssociatedMarkup, internalAdd, isTransparentResolver, iterator, iterator, newMarkupResourceStream, onAfterRenderChildren, onRender, remove, remove, removeAll, renderAll, renderAssociatedMarkup, renderComponentTagBody, renderNext, replace, setDefaultModel, setMarkupStream, size, swap, toString, toString, visitChildren, visitChildren |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public AbstractChoice(String id)
id
- See ComponentComponent.Component(String)
public AbstractChoice(String id, List<? extends E> choices)
id
- See Componentchoices
- The collection of choices in the dropdownComponent.Component(String)
public AbstractChoice(String id, List<? extends E> choices, IChoiceRenderer<? super E> renderer)
id
- See Componentrenderer
- The rendering enginechoices
- The collection of choices in the dropdownComponent.Component(String)
public AbstractChoice(String id, IModel<T> model, List<? extends E> choices)
id
- See Componentmodel
- See Componentchoices
- The collection of choices in the dropdownComponent.Component(String, IModel)
public AbstractChoice(String id, IModel<T> model, List<? extends E> choices, IChoiceRenderer<? super E> renderer)
id
- See Componentmodel
- See Componentchoices
- The drop down choicesrenderer
- The rendering engineComponent.Component(String, IModel)
public AbstractChoice(String id, IModel<? extends List<? extends E>> choices)
id
- See Componentchoices
- The collection of choices in the dropdownComponent.Component(String)
public AbstractChoice(String id, IModel<? extends List<? extends E>> choices, IChoiceRenderer<? super E> renderer)
id
- See Componentrenderer
- The rendering enginechoices
- The collection of choices in the dropdownComponent.Component(String)
public AbstractChoice(String id, IModel<T> model, IModel<? extends List<? extends E>> choices)
id
- See Componentmodel
- See Componentchoices
- The collection of choices in the dropdownComponent.Component(String, IModel)
public AbstractChoice(String id, IModel<T> model, IModel<? extends List<? extends E>> choices, IChoiceRenderer<? super E> renderer)
id
- See Componentmodel
- See Componentrenderer
- The rendering enginechoices
- The drop down choicesComponent.Component(String, IModel)
Method Detail |
---|
public List<? extends E> getChoices()
public final AbstractChoice<T,E> setChoices(IModel<? extends List<? extends E>> choices)
choices
- model representing the list of choices
public final AbstractChoice<T,E> setChoices(List<E> choices)
choices
- the list of choices
public final IChoiceRenderer<? super E> getChoiceRenderer()
public final AbstractChoice<T,E> setChoiceRenderer(IChoiceRenderer<? super E> renderer)
renderer
-
protected void detachModel()
Component
detachModel
in class Component
Component.detachModel()
protected CharSequence getDefaultChoice(Object selected)
selected
- The object that's currently selected
protected abstract boolean isSelected(E object, int index, String selected)
object
- The object to checkindex
- The index in the choices collection this object is in.selected
- The currently selected string value
protected boolean isDisabled(E object, int index, String selected)
object
- The object to checkindex
- The index in the choices collection this object is in.selected
- The currently selected string value
protected void onComponentTagBody(MarkupStream markupStream, ComponentTag openTag)
onComponentTagBody
in class MarkupContainer
markupStream
- The markup streamopenTag
- The open tag for the bodyComponent.onComponentTagBody(MarkupStream, ComponentTag)
protected void appendOptionHtml(AppendingStringBuffer buffer, E choice, int index, String selected)
buffer
- Appending string buffer that will have the generated html appendedchoice
- Choice objectindex
- The index of this optionselected
- The currently selected string valueprotected CharSequence escapeOptionHtml(String displayValue)
displayValue
-
protected boolean supportsPersistence()
supportsPersistence
in class FormComponent<T>
FormComponent.supportsPersistence()
protected boolean localizeDisplayValues()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |