Package com.jalios.jcms.taglib.settings
Class AbstractChooserSettings<T extends AbstractChooserSettings<T>>
- java.lang.Object
-
- com.jalios.jcms.taglib.settings.BasicSettings<T>
-
- com.jalios.jcms.taglib.settings.SelectorSettings<T>
-
- com.jalios.jcms.taglib.settings.AbstractChooserSettings<T>
-
- Type Parameters:
T
- Type of AbstractChooserSettings
- All Implemented Interfaces:
ControlSettings<T>
,java.lang.Cloneable
- Direct Known Subclasses:
AbstractDataSettings
,CountrySettings
,LanguageSettings
public abstract class AbstractChooserSettings<T extends AbstractChooserSettings<T>> extends SelectorSettings<T>
Abstract class to be implemented by eachControlSettings
that supports field with autocomplete and chooser window.- Author:
- ndossantos
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.jalios.jcms.taglib.settings.SelectorSettings
SelectorSettings.SelectMode, SelectorSettings.SelectorType
-
-
Field Summary
-
Fields inherited from class com.jalios.jcms.taglib.settings.SelectorSettings
ENABLE_SEARCH, ENUM_DATA_ATTRIBUTES, ENUM_LABEL_APPENDS, ENUM_LABEL_PREPENDS, ENUM_LABELS, ENUM_VALUES, INLINE, MULTIPLE, REQUIRED, SELECT_ITEM_EMPTY_VALUE, SELECT_ITEM_EMPTY_VALUE_LABEL, 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 AbstractChooserSettings()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description T
addAcChooserOption(java.lang.String name, java.lang.String... values)
Adds new autocomplete chooser option with the specified value(s).T
addChooserOption(java.lang.String name, java.lang.String... values)
Adds new chooser option with the specified value(s).protected java.lang.String
getAcChooserName()
Autocomplete chooser name used by the databroker when there is a change event in the control.protected java.lang.String
getAcChooserOption(java.util.Map<java.lang.String,java.lang.String[]> customOptionMap)
Options used by the databroker when there is a change event in the control.protected java.lang.String
getChooserIcon()
Property key whose value corresponds to the icon used for the chooser button.protected abstract java.lang.String
getChooserName()
Chooser name used by the databroker when there is a click event in the chooser button.protected abstract java.lang.String
getChooserOption(java.util.Map<java.lang.String,java.lang.String[]> customOptionMap)
Options used by the databroker when there is a click event in the chooser button.protected java.lang.String
getChooserTitle()
Title added on the chooser button.<V> V
getOption(java.lang.String optionName)
Returns the value of the specified option.T
popupHeight(int height)
Set the chooser window height.T
popupWidth(int width)
Set the chooser window with.protected <V> V
superGetOption(java.lang.String optionName)
Method used internally byCommonChooserSettings
to call the getOption(String) method in the parent class of the current class.protected boolean
useCurrentWorkspace()
Override this method and return 'true' to add current Workspace in chooser option if not defined by WORKSPACE option.T
workspace(Workspace workspace)
Set the Workspace to which you filter in the chooser window and in the autocomplete.T
workspace(java.lang.String workspaceId)
Set the Workspace ID to which you filter in the chooser window and in the autocomplete.-
Methods inherited from class com.jalios.jcms.taglib.settings.SelectorSettings
checkbox, chooser, disableInline, emptyValueLabel, enumDataAttribute, enumLabelAppends, enumLabelAppends, enumLabelAppends, enumLabelPreprends, enumLabelPreprends, enumLabelPreprends, enumLabels, enumLabels, enumLabels, enumValues, enumValues, enumValues, inline, multiple, radio, required, resolveOptions, select, select, selectorType, single
-
Methods inherited from class com.jalios.jcms.taglib.settings.BasicSettings
addOption, append, aria, aria, autofocus, clearOption, clone, css, dataAttribute, dataAttributes, disable, 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
-
-
-
-
Method Detail
-
getChooserName
protected abstract java.lang.String getChooserName()
Chooser name used by the databroker when there is a click event in the chooser button.- Returns:
- The chooser name
- See Also:
- "/js/jalios/core/jalios-widget-chooser.js"
-
getAcChooserName
protected java.lang.String getAcChooserName()
Autocomplete chooser name used by the databroker when there is a change event in the control.- Returns:
- the autocomplete chooser name
- See Also:
- "/js/jalios/core/jalios-autocomplete-chooser.js"
-
getChooserOption
protected abstract java.lang.String getChooserOption(java.util.Map<java.lang.String,java.lang.String[]> customOptionMap)
Options used by the databroker when there is a click event in the chooser button.- Parameters:
customOptionMap
- Extra chooser options forwarded by the optionChooserConstants.EXTRA_CHOOSER_OPTION
and appended to the query string- Returns:
String
representing the options as query string
-
getAcChooserOption
protected java.lang.String getAcChooserOption(java.util.Map<java.lang.String,java.lang.String[]> customOptionMap)
Options used by the databroker when there is a change event in the control.- Parameters:
customOptionMap
- Extra chooser options forwarded by the optionChooserConstants.EXTRA_CHOOSER_OPTION
and appended to the query string- Returns:
String
representing the options as query string
-
getChooserIcon
protected java.lang.String getChooserIcon()
Property key whose value corresponds to the icon used for the chooser button.Example:
If we declare the following icon property:icon.chooser-publication: glyph: icomoon-file-text2
chooser-publication
- Returns:
- Property key representing the chooser button icon
-
getChooserTitle
protected java.lang.String getChooserTitle()
Title added on the chooser button.- Returns:
- The chooser button title
-
useCurrentWorkspace
protected boolean useCurrentWorkspace()
Override this method and return 'true' to add current Workspace in chooser option if not defined by WORKSPACE option.- Returns:
true
to use the current workspace,false
instead
-
superGetOption
protected final <V> V superGetOption(java.lang.String optionName)
Method used internally byCommonChooserSettings
to call the getOption(String) method in the parent class of the current class.- Parameters:
optionName
- Option name- Returns:
- Option value
-
getOption
public <V> V getOption(java.lang.String optionName)
Description copied from interface:ControlSettings
Returns the value of the specified option.- Specified by:
getOption
in interfaceControlSettings<T extends AbstractChooserSettings<T>>
- Overrides:
getOption
in classBasicSettings<T extends AbstractChooserSettings<T>>
- Parameters:
optionName
- Option name- Returns:
- Option value
-
addChooserOption
public T addChooserOption(java.lang.String name, java.lang.String... values)
Adds new chooser option with the specified value(s). If the given value is null, the option is ignored.- Parameters:
name
- Chooser option namevalues
- Chooser option value(s)- Returns:
- a reference to this object - used to chain calls
-
addAcChooserOption
public T addAcChooserOption(java.lang.String name, java.lang.String... values)
Adds new autocomplete chooser option with the specified value(s). If the given value is null, the option is ignored.- Parameters:
name
- Autocomplete chooser option namevalues
- Autocomplete chooser option value(s)- Returns:
- a reference to this object - used to chain calls
-
workspace
public T workspace(java.lang.String workspaceId)
Set the Workspace ID to which you filter in the chooser window and in the autocomplete.- Parameters:
workspaceId
- Workspace ID- Returns:
- a reference to this object - used to chain calls
-
workspace
public T workspace(Workspace workspace)
Set the Workspace to which you filter in the chooser window and in the autocomplete.- Parameters:
workspace
- Workspace- Returns:
- a reference to this object - used to chain calls
-
popupWidth
public T popupWidth(int width)
Set the chooser window with.- Parameters:
width
- Chooser window width- Returns:
- a reference to this object - used to chain calls
-
popupHeight
public T popupHeight(int height)
Set the chooser window height.- Parameters:
height
- Chooser window height- Returns:
- a reference to this object - used to chain calls
-
-