Class Options
- All Implemented Interfaces:
Serializable,org.apache.wicket.model.IDetachable,org.apache.wicket.model.IModel<Options>,org.apache.wicket.util.io.IClusterable
Wraps a set of options possibly defined for a WiQuery Component.
By default, Options are rendered as a JavaScript object like this:
{
option1: 'value1',
option2: 'value2
}
This rendering can be customized by creating a IOptionsRenderer.
- Since:
- 0.5
- Author:
- Lionel Armanet, Hielke Hoeve, Ernesto Reinaldo Barreiro
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancontainsKey(Object key) Returns if the given option is defined or not.voiddetach()Returns the given option value as a String.getBoolean(String key) Returns the given option value.Returns the given option value.getComplexOption(String key) Returns the given option value.Returns the given option value.Returns the given option value.Returns the given option value.Returns the JavaScript statement corresponding to options.getJsScope(String key) Returns the given option value.getLiteral(String key) Returns the given option value.Returns the given option value.booleanisEmpty()Put an boolean value for the given option name.Puts an double value for the given option name.Puts an float value for the given option name.Puts an int value for the given option name.Puts aLongvalue for the given option name.Puts an short value for the given option name.Puts aStringvalue for the given option name.Puts aJsScopevalue for the given option name.put(String key, ICollectionItemOptions value) Puts a list of IListItemOption value for the given option name.put(String key, IComplexOption value) Puts a complex option value for the given option name.putBoolean(String key, org.apache.wicket.model.IModel<Boolean> value) Put an boolean value for the given option name.Puts an IModel <Double> value for the given option name.Puts an IModel <Double> value for the given option name.putInteger(String key, org.apache.wicket.model.IModel<Integer> value) Puts an int value for the given option name.putLiteral(String key, String value) Puts aStringvalue as a JavaScript literal for the given name.putLiteral(String key, org.apache.wicket.model.IModel<String> value) Puts aStringvalue as a JavaScript literal for the given name.Puts aLongvalue for the given option name.Puts an short value for the given option name.Puts aStringvalue for the given option name.voidremoveOption(String key) Removes an option for a given name.voidvoidsetOwner(org.apache.wicket.Component owner) voidsetRenderer(IOptionsRenderer optionsRenderer) Sets the renderer to use.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.wicket.model.IModel
as, combineWith, filter, flatMap, isPresent, map, orElse, orElseGet
-
Constructor Details
-
Method Details
-
setOwner
public void setOwner(org.apache.wicket.Component owner) -
containsKey
Returns if the given option is defined or not.
- Parameters:
key- the option name.
-
get
Returns the given option value as a String.
- Parameters:
key- the option name.
-
getBoolean
Returns the given option value.
- Parameters:
key- the option name.
-
getJsScope
Returns the given option value.
- Parameters:
key- the option name.
-
getComplexOption
Returns the given option value.
- Parameters:
key- the option name.- Returns:
- the complex option
-
getDouble
Returns the given option value.
- Parameters:
key- the option name.
-
getFloat
Returns the given option value.
- Parameters:
key- the option name.
-
getInt
Returns the given option value.
- Parameters:
key- the option name.
-
getJavaScriptOptions
Returns the JavaScript statement corresponding to options. -
getCollectionItemOptions
Returns the given option value.
- Parameters:
key- the option name.- Returns:
- the list
-
getLiteral
Returns the given option value.
- Parameters:
key- the option name.
-
getShort
Returns the given option value.
- Parameters:
key- the option name.
-
isEmpty
public boolean isEmpty()- Returns:
- true if no options are defined, false otherwise.
-
put
Put an boolean value for the given option name.
- Parameters:
key- the option name.value- the boolean value.
-
putBoolean
Put an boolean value for the given option name.
- Parameters:
key- the option name.value- the boolean value.
-
put
Puts an double value for the given option name.
- Parameters:
key- the option name.value- the float double.
-
putDouble
Puts an IModel <Double> value for the given option name.
- Parameters:
key- the option name.value- the float value.
-
put
Puts an float value for the given option name.
- Parameters:
key- the option namevalue- The float value
-
putFloat
Puts an IModel <Double> value for the given option name.
- Parameters:
key- the option name.value- the float double.
-
put
Puts a list of IListItemOption value for the given option name.
- Parameters:
key- the option name.value- the IListItemOption list.
-
put
Puts a complex option value for the given option name.
- Parameters:
key- the option name.value- the IComplexOption.
-
put
Puts an int value for the given option name.
- Parameters:
key- the option name.value- the int value.
-
putInteger
Puts an int value for the given option name.
- Parameters:
key- the option name.value- the int value.
-
put
Puts a
JsScopevalue for the given option name.- Parameters:
key- the option name.value- theJsScopevalue.
-
put
Puts an short value for the given option name.
- Parameters:
key- the option name.value- the short value.
-
putShort
Puts an short value for the given option name.
- Parameters:
key- the option name.value- the short value.
-
put
Puts a
Stringvalue for the given option name.- Parameters:
key- the option name.value- theStringvalue.
-
putString
Puts a
Stringvalue for the given option name.- Parameters:
key- the option name.value- theStringvalue.
-
put
Puts a
Longvalue for the given option name.- Parameters:
key- the option name.value- theLongvalue.
-
putLong
Puts a
Longvalue for the given option name.- Parameters:
key- the option name.value- theLongvalue.
-
putLiteral
Puts a
Stringvalue as a JavaScript literal for the given name.Note that the JavaScript resulting from this options will be
'value'- Parameters:
key- the option name.value- theLiteralOptionvalue.
-
putLiteral
Puts a
Stringvalue as a JavaScript literal for the given name.Note that the JavaScript resulting from this options will be
'value'- Parameters:
key- the option name.value- theLiteralOptionvalue.
-
removeOption
Removes an option for a given name.
- Parameters:
key- the option's key to remove.
-
setRenderer
Sets the renderer to use. -
getObject
- Specified by:
getObjectin interfaceorg.apache.wicket.model.IModel<Options>
-
setObject
- Specified by:
setObjectin interfaceorg.apache.wicket.model.IModel<Options>
-
detach
public void detach()- Specified by:
detachin interfaceorg.apache.wicket.model.IDetachable- Specified by:
detachin interfaceorg.apache.wicket.model.IModel<Options>
-