Package com.jalios.jcms.taglib.settings
Class AbstractCategorySettings<T extends AbstractCategorySettings<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>
-
- com.jalios.jcms.taglib.settings.AbstractDataSettings<T>
-
- com.jalios.jcms.taglib.settings.AbstractCategorySettings<T>
-
- Type Parameters:
T
- Type ofAbstractCategorySettings
- All Implemented Interfaces:
ControlSettings<T>
,java.lang.Cloneable
- Direct Known Subclasses:
CategorySettings
,CategoryTreeSettings
public abstract class AbstractCategorySettings<T extends AbstractCategorySettings<T>> extends AbstractDataSettings<T>
Abstract class to be implemented by eachControlSettings
that supports categories.- Author:
- ndossantos
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.jalios.jcms.taglib.settings.SelectorSettings
SelectorSettings.SelectMode, SelectorSettings.SelectorType
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
CATEGORY_FILTER
static java.lang.String
DISPLAY_ROOTS
static java.lang.String
LIVE_CREATION
static java.lang.String
ORIGINAL_ROOT_CATEGORY
If displayRoot == false, we must display the children categories.static java.lang.String
ROOT_CATEGORIES
static java.lang.String
SEARCH
static java.lang.String
SELECTABLE
static java.lang.String
TREE
-
Fields inherited from class com.jalios.jcms.taglib.settings.AbstractDataSettings
DATA_CLASS
-
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 AbstractCategorySettings()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description T
clone()
Clone the current ControlSettings.T
disableLiveCreation()
Disable the category creation proposal if it does not exist.T
displayRoots(boolean displayRoots)
Whether the root categories are displayed or not.T
filter(CategoryFilter filter)
Set theCategoryFilter
in order to filter the categories to display.T
filter(java.lang.String filter)
Set the filter asString
in order to filter the categories to display.
Thefilter
parameter accepts one of the names corresponding to theCategoryFilter
enum constants.
Thefilter
parameter can be in lower case or upper case.protected java.lang.String
getChooserName()
Chooser name used by the databroker when there is a click event in the chooser button.protected 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.java.lang.Class<? extends Data>
getDataClass()
Data class supported by the currentControlSettings
<V> V
getOption(java.lang.String optionName)
Returns the value of the specified option.ControlType
getType()
Returns theControlType
related to the currentControlSettings
implementation.void
resolveOptions(TypeFieldEntry tfe)
Set options from the specifiedTypeFieldEntry
.Category[]
resolveRootCategories()
Returns the categories to display according to the 'displayRoots' attribute is true or false.T
root(Category[] categories)
Set the Root categories.T
root(Category category, Category... otherCategories)
Set the Root categories.T
root(java.lang.String[] categoryIds)
Set the IDs of root categories.T
root(java.lang.String categoryId, java.lang.String... otherCategoryIds)
Set the Root categories.T
root(java.util.Collection<Category> categories)
Set the Root categories.T
uncheckSelectable()
Do not check if categories are selectable.-
Methods inherited from class com.jalios.jcms.taglib.settings.AbstractChooserSettings
addAcChooserOption, addChooserOption, getAcChooserName, getAcChooserOption, getChooserIcon, getChooserTitle, popupHeight, popupWidth, superGetOption, useCurrentWorkspace, workspace, workspace
-
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, select, select, selectorType, single
-
Methods inherited from class com.jalios.jcms.taglib.settings.BasicSettings
addOption, append, aria, aria, autofocus, clearOption, 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
-
-
-
-
Field Detail
-
ROOT_CATEGORIES
public static final java.lang.String ROOT_CATEGORIES
- See Also:
- Constant Field Values
-
DISPLAY_ROOTS
public static final java.lang.String DISPLAY_ROOTS
- See Also:
- Constant Field Values
-
CATEGORY_FILTER
public static final java.lang.String CATEGORY_FILTER
- See Also:
- Constant Field Values
-
SELECTABLE
public static final java.lang.String SELECTABLE
- See Also:
- Constant Field Values
-
LIVE_CREATION
public static final java.lang.String LIVE_CREATION
- See Also:
- Constant Field Values
-
TREE
public static final java.lang.String TREE
- See Also:
- Constant Field Values
-
SEARCH
public static final java.lang.String SEARCH
- See Also:
- Constant Field Values
-
ORIGINAL_ROOT_CATEGORY
public static final java.lang.String ORIGINAL_ROOT_CATEGORY
If displayRoot == false, we must display the children categories. If there is not, it displays an empty category tree. We need to display a message with the support of the right click to add new categories, but we don't have the root category information because treecatview tag has only one attribute 'collection' which is then empty. TODO The treecatview tag should have two attributes as in JCMS 8.x: rootSet and displayRoot- See Also:
- Constant Field Values
-
-
Method Detail
-
getType
public ControlType getType()
Description copied from interface:ControlSettings
Returns theControlType
related to the currentControlSettings
implementation.- Returns:
ControlType
-
getDataClass
public java.lang.Class<? extends Data> getDataClass()
Description copied from class:AbstractDataSettings
Data class supported by the currentControlSettings
- Specified by:
getDataClass
in classAbstractDataSettings<T extends AbstractCategorySettings<T>>
- Returns:
- The
Data
class
-
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 AbstractCategorySettings<T>>
- Overrides:
getOption
in classAbstractDataSettings<T extends AbstractCategorySettings<T>>
- Parameters:
optionName
- Option name- Returns:
- Option value
-
resolveOptions
public void resolveOptions(TypeFieldEntry tfe)
Description copied from interface:ControlSettings
Set options from the specifiedTypeFieldEntry
.- Specified by:
resolveOptions
in interfaceControlSettings<T extends AbstractCategorySettings<T>>
- Overrides:
resolveOptions
in classSelectorSettings<T extends AbstractCategorySettings<T>>
- Parameters:
tfe
-TypeFieldEntry
-
getChooserName
protected java.lang.String getChooserName()
Description copied from class:AbstractChooserSettings
Chooser name used by the databroker when there is a click event in the chooser button.- Specified by:
getChooserName
in classAbstractChooserSettings<T extends AbstractCategorySettings<T>>
- Returns:
- The chooser name
- See Also:
- "/js/jalios/core/jalios-widget-chooser.js"
-
getChooserOption
protected java.lang.String getChooserOption(java.util.Map<java.lang.String,java.lang.String[]> customOptionMap)
Description copied from class:AbstractChooserSettings
Options used by the databroker when there is a click event in the chooser button.- Overrides:
getChooserOption
in classAbstractDataSettings<T extends AbstractCategorySettings<T>>
- 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
-
clone
public T clone() throws java.lang.CloneNotSupportedException
Description copied from interface:ControlSettings
Clone the current ControlSettings.- Specified by:
clone
in interfaceControlSettings<T extends AbstractCategorySettings<T>>
- Overrides:
clone
in classBasicSettings<T extends AbstractCategorySettings<T>>
- Returns:
- the new cloned ControlSettings
- Throws:
java.lang.CloneNotSupportedException
-
root
public T root(java.lang.String[] categoryIds)
Set the IDs of root categories.- Parameters:
categoryIds
- Root category IDs- Returns:
- a reference to this object - used to chain calls
-
root
public T root(Category[] categories)
Set the Root categories.- Parameters:
categories
- array ofCategory
representing the Root categories- Returns:
- a reference to this object - used to chain calls
- See Also:
root(String[])
-
root
public T root(java.util.Collection<Category> categories)
Set the Root categories.- Parameters:
categories
- Collection ofCategory
representing the Root categories- Returns:
- a reference to this object - used to chain calls
- See Also:
root(Category[])
-
root
public T root(Category category, Category... otherCategories)
Set the Root categories.- Parameters:
category
- The first root categoryotherCategories
- The other root Categories- Returns:
- a reference to this object - used to chain calls
- See Also:
root(String[])
-
root
public T root(java.lang.String categoryId, java.lang.String... otherCategoryIds)
Set the Root categories.- Parameters:
categoryId
- The first root category IDotherCategoryIds
- The other root Category IDs- Returns:
- a reference to this object - used to chain calls
- See Also:
root(String[])
-
displayRoots
public T displayRoots(boolean displayRoots)
Whether the root categories are displayed or not.- Parameters:
displayRoots
-true
to display the root categories, insteadfalse
- Returns:
- a reference to this object - used to chain calls
-
filter
public T filter(CategoryFilter filter)
Set theCategoryFilter
in order to filter the categories to display.- Parameters:
filter
-CategoryFilter
- Returns:
- a reference to this object - used to chain calls
- See Also:
CategoryFilter
-
filter
public T filter(java.lang.String filter)
Set the filter asString
in order to filter the categories to display.
Thefilter
parameter accepts one of the names corresponding to theCategoryFilter
enum constants.
Thefilter
parameter can be in lower case or upper case.- Parameters:
filter
- the name of theCategoryFilter
enum constant- Returns:
- a reference to this object - used to chain calls
- See Also:
CategoryFilter
-
uncheckSelectable
public T uncheckSelectable()
Do not check if categories are selectable. If the category is not usually selectable, it can be, in the same way as the other categories.- Returns:
- a reference to this object - used to chain calls
-
disableLiveCreation
public T disableLiveCreation()
Disable the category creation proposal if it does not exist.- Returns:
- a reference to this object - used to chain calls
-
-