Class SelectorSettings<T extends SelectorSettings<T>>
- java.lang.Object
-
- com.jalios.jcms.taglib.settings.BasicSettings<T>
-
- com.jalios.jcms.taglib.settings.SelectorSettings<T>
-
- Type Parameters:
T
- Type of SelectorSettings
- All Implemented Interfaces:
ControlSettings<T>
,java.lang.Cloneable
- Direct Known Subclasses:
AbstractChooserSettings
,BooleanSettings
,DefaultSettings
,EnumerateSettings
,TimeZoneSettings
public abstract class SelectorSettings<T extends SelectorSettings<T>> extends BasicSettings<T>
Abstract class to be implemented by eachControlSettings
that supports fields "checkbox" (checkbox()
), "radio" (radio()
), "select" (select()
) or "chooser" (chooser()
).Default is "radio".
- Author:
- ndossantos
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SelectorSettings.SelectMode
static class
SelectorSettings.SelectorType
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
ENABLE_SEARCH
static java.lang.String
ENUM_DATA_ATTRIBUTES
static java.lang.String
ENUM_LABEL_APPENDS
static java.lang.String
ENUM_LABEL_PREPENDS
static java.lang.String
ENUM_LABELS
static java.lang.String
ENUM_VALUES
static java.lang.String
INLINE
static java.lang.String
MULTIPLE
static java.lang.String
REQUIRED
static java.lang.String
SELECT_ITEM_EMPTY_VALUE
static java.lang.String
SELECT_ITEM_EMPTY_VALUE_LABEL
static java.lang.String
SELECTOR_TYPE
-
Fields inherited from class com.jalios.jcms.taglib.settings.BasicSettings
APPEND, ARIA_ATTR_PREFIX, ARIA_ATTRIBUTES, AUTOFOCUS, CLEAR_BUTTON, CSS, DATA_ATTR_PREFIX, DATA_ATTRIBUTES, DISABLED, HIDE_CLEAR_BUTTON, HTML_ATTRIBUTES, ID, LANGUAGE_CHOOSER, MAX_LENGTH, NAME, PLACEHOLDER, PREPEND, READONLY, TITLE, TRIGGER_ACTION, TRIGGER_EVENT, VALUE
-
-
Constructor Summary
Constructors Constructor Description SelectorSettings()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description T
checkbox()
Set the control as "checkbox".T
chooser()
Set the control as "chooser".T
disableInline()
Disable the inline mode.T
emptyValueLabel(java.lang.String label)
Specify wether the SELECT html tag empty value in case of a non required field.T
enumDataAttribute(java.util.List<DataAttribute> dataAttributes)
T
enumLabelAppends(java.lang.String[] enumLabelAppends)
Specify the text to append to labels in this settings.T
enumLabelAppends(java.lang.String enumLabelAppend, java.lang.String... otherEnumLabelAppends)
Specify the text to append to labels in this settings.T
enumLabelAppends(java.util.Collection<java.lang.String> enumLabelAppends)
Specify the text to append to labels in this settings.T
enumLabelPreprends(java.lang.String[] enumLabelPrepends)
Specify the text to prepend to labels in this settings.T
enumLabelPreprends(java.lang.String enumLabelPrepend, java.lang.String... otherEnumLabelPrepends)
Specify the text to prepend to labels in this settings.T
enumLabelPreprends(java.util.Collection<java.lang.String> enumLabelPrepends)
Specify the text to prepend to labels in this settings.T
enumLabels(java.lang.String[] enumLabels)
Specify the labels to use for this settings.T
enumLabels(java.lang.String enumLabel, java.lang.String... otherEnumLabels)
Specify the labels to use for this settings.T
enumLabels(java.util.Collection<java.lang.String> enumLabels)
Specify the labels to use for this settings.T
enumValues(java.lang.Object[] enumValues)
Set the array of values to use for this settings.T
enumValues(java.lang.Object enumValue, java.lang.Object... otherEnumValues)
Set the values to use for this settings.T
enumValues(java.util.Collection<?> enumValues)
Set the collection of values to use for this settings.T
inline()
Specify whether the enumerated items are displayed in inline mode.T
multiple()
Specify whether multiple items can be selected.T
radio()
Set the control as "radio".T
required()
Specify if the control is required and cannot be empty.void
resolveOptions(TypeFieldEntry tfe)
Set options from the specifiedTypeFieldEntry
.T
select()
Set the control as "select".T
select(boolean enableSearch)
Set the control as "select".T
selectorType(SelectorSettings.SelectorType selectorType)
Set theSelectorSettings.SelectorType
.T
single()
Specify if only one item can be selected.-
Methods inherited from class com.jalios.jcms.taglib.settings.BasicSettings
addOption, append, aria, aria, autofocus, clearOption, clone, css, dataAttribute, dataAttributes, disable, getOption, getOptionNames, getThis, htmlAttributes, htmlAttributes, id, isChannelReady, maxLength, merge, name, onChange, onFocusOut, placeholder, prepend, readonly, removeOption, require, showLanguageChooser, sortSet, title, toStringArray, toStringArray, toStringArray, toStringArray, toStringArray, trigger, value
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.jalios.jcms.taglib.settings.ControlSettings
getType
-
-
-
-
Field Detail
-
SELECTOR_TYPE
public static final java.lang.String SELECTOR_TYPE
- See Also:
- Constant Field Values
-
ENUM_DATA_ATTRIBUTES
public static final java.lang.String ENUM_DATA_ATTRIBUTES
- See Also:
- Constant Field Values
-
ENUM_VALUES
public static final java.lang.String ENUM_VALUES
- See Also:
- Constant Field Values
-
ENUM_LABELS
public static final java.lang.String ENUM_LABELS
- See Also:
- Constant Field Values
-
ENUM_LABEL_PREPENDS
public static final java.lang.String ENUM_LABEL_PREPENDS
- See Also:
- Constant Field Values
-
ENUM_LABEL_APPENDS
public static final java.lang.String ENUM_LABEL_APPENDS
- See Also:
- Constant Field Values
-
INLINE
public static final java.lang.String INLINE
- See Also:
- Constant Field Values
-
MULTIPLE
public static final java.lang.String MULTIPLE
- See Also:
- Constant Field Values
-
REQUIRED
public static final java.lang.String REQUIRED
- See Also:
- Constant Field Values
-
SELECT_ITEM_EMPTY_VALUE_LABEL
public static final java.lang.String SELECT_ITEM_EMPTY_VALUE_LABEL
- See Also:
- Constant Field Values
-
SELECT_ITEM_EMPTY_VALUE
public static final java.lang.String SELECT_ITEM_EMPTY_VALUE
- See Also:
- Constant Field Values
-
ENABLE_SEARCH
public static final java.lang.String ENABLE_SEARCH
- See Also:
- Constant Field Values
-
-
Method Detail
-
selectorType
public T selectorType(SelectorSettings.SelectorType selectorType)
Set theSelectorSettings.SelectorType
.- Parameters:
selectorType
-SelectorSettings.SelectorType
- Returns:
- a reference to this object - used to chain calls
- See Also:
SelectorSettings.SelectorType
-
chooser
public T chooser()
Set the control as "chooser".- Returns:
- a reference to this object - used to chain calls
- See Also:
SelectorSettings.SelectorType.CHOOSER
-
select
public T select()
Set the control as "select".- Returns:
- a reference to this object - used to chain calls
- See Also:
SelectorSettings.SelectorType.SELECT
-
select
public T select(boolean enableSearch)
Set the control as "select".- Parameters:
enableSearch
- to define if you want to provide search on this select- Returns:
- a reference to this object - used to chain calls
- See Also:
SelectorSettings.SelectorType.SELECT
-
checkbox
public T checkbox()
Set the control as "checkbox".- Returns:
- a reference to this object - used to chain calls
- See Also:
SelectorSettings.SelectorType.CHECKBOX
-
radio
public T radio()
Set the control as "radio".- Returns:
- a reference to this object - used to chain calls
- See Also:
SelectorSettings.SelectorType.RADIO
-
enumValues
public T enumValues(java.lang.Object[] enumValues)
Set the array of values to use for this settings.- Parameters:
enumValues
- Array of values to use- Returns:
- a reference to this object - used to chain calls
-
enumValues
public T enumValues(java.util.Collection<?> enumValues)
Set the collection of values to use for this settings.- Parameters:
enumValues
- Collection of values to use- Returns:
- a reference to this object - used to chain calls
- See Also:
enumValues(Object[])
-
enumValues
public T enumValues(java.lang.Object enumValue, java.lang.Object... otherEnumValues)
Set the values to use for this settings.- Parameters:
enumValue
- the first valueotherEnumValues
- The other values- Returns:
- a reference to this object - used to chain calls
- See Also:
enumValues(Object[])
-
enumDataAttribute
public T enumDataAttribute(java.util.List<DataAttribute> dataAttributes)
-
enumLabels
public T enumLabels(java.lang.String[] enumLabels)
Specify the labels to use for this settings.HTML is not authorized, any HTML syntax will be encoded (since JCMS-6503), use
enumLabelPreprends(String[])
orenumLabelAppends(String[])
if you want to specify HTML syntax for your settings label.- Parameters:
enumLabels
- the labels to use.- Returns:
- a reference to this object - used to chain calls
- See Also:
enumLabelPreprends(String[])
,enumLabelAppends(String[])
-
enumLabels
public T enumLabels(java.util.Collection<java.lang.String> enumLabels)
Specify the labels to use for this settings.HTML is not authorized, any HTML syntax will be encoded (since JCMS-6503), use
enumLabelPreprends(Collection)
orenumLabelAppends(Collection)
if you want to specify HTML syntax for your settings label.- Parameters:
enumLabels
- the labels to use.- Returns:
- a reference to this object - used to chain calls
- See Also:
enumLabelPreprends(Collection)
,enumLabelAppends(Collection)
-
enumLabels
public T enumLabels(java.lang.String enumLabel, java.lang.String... otherEnumLabels)
Specify the labels to use for this settings.HTML is not authorized, any HTML syntax will be encoded (since JCMS-6503), use
enumLabelPreprends(String, String...)
orenumLabelAppends(String, String...)
if you want to specify HTML syntax for your settings label.- Parameters:
enumLabel
- the first label to use.otherEnumLabels
- the next labels to use.- Returns:
- a reference to this object - used to chain calls
- See Also:
enumLabelPreprends(String, String...)
,enumLabelAppends(String, String...)
-
enumLabelPreprends
public T enumLabelPreprends(java.lang.String[] enumLabelPrepends)
Specify the text to prepend to labels in this settings.HTML may be specified and will be printed exactly as received.
- Parameters:
enumLabelPrepends
- the prepend strings to use.- Returns:
- a reference to this object - used to chain calls
- See Also:
enumLabels(String[])
,enumLabelAppends(String[])
-
enumLabelPreprends
public T enumLabelPreprends(java.util.Collection<java.lang.String> enumLabelPrepends)
Specify the text to prepend to labels in this settings.HTML may be specified and will be printed exactly as received.
- Parameters:
enumLabelPrepends
- the prepend strings to use.- Returns:
- a reference to this object - used to chain calls
- See Also:
enumLabels(Collection)
,enumLabelAppends(Collection)
-
enumLabelPreprends
public T enumLabelPreprends(java.lang.String enumLabelPrepend, java.lang.String... otherEnumLabelPrepends)
Specify the text to prepend to labels in this settings.HTML may be specified and will be printed exactly as received.
- Parameters:
enumLabelPrepend
- the first prepend string to use.otherEnumLabelPrepends
- the other prepend strings to use.- Returns:
- a reference to this object - used to chain calls
- See Also:
enumLabels(String, String...)
,enumLabelAppends(String, String...)
-
enumLabelAppends
public T enumLabelAppends(java.lang.String[] enumLabelAppends)
Specify the text to append to labels in this settings.HTML may be specified and will be printed exactly as received.
- Parameters:
enumLabelAppends
- the append strings to use.- Returns:
- a reference to this object - used to chain calls
- See Also:
enumLabelPreprends(String[])
,enumLabels(String[])
-
enumLabelAppends
public T enumLabelAppends(java.util.Collection<java.lang.String> enumLabelAppends)
Specify the text to append to labels in this settings.HTML may be specified and will be printed exactly as received.
- Parameters:
enumLabelAppends
- the append strings to use.- Returns:
- a reference to this object - used to chain calls
- See Also:
enumLabelPreprends(Collection)
,enumLabels(Collection)
-
enumLabelAppends
public T enumLabelAppends(java.lang.String enumLabelAppend, java.lang.String... otherEnumLabelAppends)
Specify the text to append to labels in this settings.HTML may be specified and will be printed exactly as received.
- Parameters:
enumLabelAppend
- the first append string to use.otherEnumLabelAppends
- the other append strings to use.- Returns:
- a reference to this object - used to chain calls
- See Also:
enumLabelPreprends(String, String...)
,enumLabels(String, String...)
-
inline
public T inline()
Specify whether the enumerated items are displayed in inline mode.- Returns:
- a reference to this object - used to chain calls
-
disableInline
public T disableInline()
Disable the inline mode.- Returns:
- a reference to this object - used to chain calls
-
multiple
public T multiple()
Specify whether multiple items can be selected.This methods is only used for the select fields (
select()
) and chooser fields (chooser()
). If this method is used for other selector types (radio()
,checkbox()
), it will have no effect.When the selector is defined as 'chooser' (
chooser()
), this method allows to have multiple values in the same field :
Example :<jalios:field name="myfield" label="Multiple categories in one input" value='<%= Util.join(selectedCategoryIds, " ") %>'> <jalios:control settings='<%= new CategorySettings().multiple() %>' /> </jalios:field>
- Returns:
- a reference to this object - used to chain calls
- See Also:
SELECTOR_TYPE
,selectorType(SelectorType)
,radio()
,checkbox()
,select()
,chooser()
-
emptyValueLabel
public T emptyValueLabel(java.lang.String label)
Specify wether the SELECT html tag empty value in case of a non required field.- Parameters:
label
- to set the label of the first empty value- Returns:
- a reference to this object - used to chain calls
- Since:
- jcms-10.0.5
-
single
public T single()
Specify if only one item can be selected.This methods is only used for the select fields (
select()
) and chooser fields (chooser()
). If this method is used for other selector types (radio()
,checkbox()
), it will have no effect.- Returns:
- a reference to this object - used to chain calls
- See Also:
SELECTOR_TYPE
,selectorType(SelectorType)
,radio()
,checkbox()
,select()
,chooser()
-
required
public T required()
Specify if the control is required and cannot be empty.- Returns:
- a reference to this object - used to chain calls
-
resolveOptions
public void resolveOptions(TypeFieldEntry tfe)
Description copied from interface:ControlSettings
Set options from the specifiedTypeFieldEntry
.- Specified by:
resolveOptions
in interfaceControlSettings<T extends SelectorSettings<T>>
- Overrides:
resolveOptions
in classBasicSettings<T extends SelectorSettings<T>>
- Parameters:
tfe
-TypeFieldEntry
-
-