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 eachControlSettingsthat supports categories.- Author:
- ndossantos
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.jalios.jcms.taglib.settings.SelectorSettings
SelectorSettings.SegmentedType, SelectorSettings.SelectMode, SelectorSettings.SelectorType
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringCATEGORY_FILTERstatic java.lang.StringDISPLAY_ROOTSstatic java.lang.StringLIVE_CREATIONstatic java.lang.StringORIGINAL_ROOT_CATEGORYIf displayRoot == false, we must display the children categories.static java.lang.StringROOT_CATEGORIESstatic java.lang.StringSEARCHstatic java.lang.StringSELECTABLEstatic java.lang.StringTREE-
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, SEGMENTED_TYPE, SEGMENTED_TYPE_DEFAULT, SELECT_ITEM_EMPTY_VALUE, SELECT_ITEM_EMPTY_VALUE_LABEL, SELECTOR_TYPE, WRAPPER_CSS
-
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 Tclone()Clone the current ControlSettings.TdisableLiveCreation()Disable the category creation proposal if it does not exist.TdisplayRoots(boolean displayRoots)Whether the root categories are displayed or not.Tfilter(CategoryFilter filter)Set theCategoryFilterin order to filter the categories to display.Tfilter(java.lang.String filter)Set the filter asStringin order to filter the categories to display.
Thefilterparameter accepts one of the names corresponding to theCategoryFilterenum constants.
Thefilterparameter can be in lower case or upper case.protected java.lang.StringgetChooserName()Chooser name used by the databroker when there is a click event in the chooser button.protected java.lang.StringgetChooserOption(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> VgetOption(java.lang.String optionName)Returns the value of the specified option.ControlTypegetType()Returns theControlTyperelated to the currentControlSettingsimplementation.voidresolveOptions(TypeFieldEntry tfe)Set options from the specifiedTypeFieldEntry.Category[]resolveRootCategories()Returns the categories to display according to the 'displayRoots' attribute is true or false.Troot(Category[] categories)Set the Root categories.Troot(Category category, Category... otherCategories)Set the Root categories.Troot(java.lang.String[] categoryIds)Set the IDs of root categories.Troot(java.lang.String categoryId, java.lang.String... otherCategoryIds)Set the Root categories.Troot(java.util.Collection<Category> categories)Set the Root categories.TuncheckSelectable()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, segmented, select, select, selectorType, single, wrapperCss
-
Methods inherited from class com.jalios.jcms.taglib.settings.BasicSettings
addOption, append, aria, aria, autofocus, clearOption, css, dataAttribute, 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:ControlSettingsReturns theControlTyperelated to the currentControlSettingsimplementation.- Returns:
ControlType
-
getDataClass
public java.lang.Class<? extends Data> getDataClass()
Description copied from class:AbstractDataSettingsData class supported by the currentControlSettings- Specified by:
getDataClassin classAbstractDataSettings<T extends AbstractCategorySettings<T>>- Returns:
- The
Dataclass
-
getOption
public <V> V getOption(java.lang.String optionName)
Description copied from interface:ControlSettingsReturns the value of the specified option.- Specified by:
getOptionin interfaceControlSettings<T extends AbstractCategorySettings<T>>- Overrides:
getOptionin classAbstractDataSettings<T extends AbstractCategorySettings<T>>- Parameters:
optionName- Option name- Returns:
- Option value
-
resolveOptions
public void resolveOptions(TypeFieldEntry tfe)
Description copied from interface:ControlSettingsSet options from the specifiedTypeFieldEntry.- Specified by:
resolveOptionsin interfaceControlSettings<T extends AbstractCategorySettings<T>>- Overrides:
resolveOptionsin classSelectorSettings<T extends AbstractCategorySettings<T>>- Parameters:
tfe-TypeFieldEntry
-
getChooserName
protected java.lang.String getChooserName()
Description copied from class:AbstractChooserSettingsChooser name used by the databroker when there is a click event in the chooser button.- Specified by:
getChooserNamein 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:AbstractChooserSettingsOptions used by the databroker when there is a click event in the chooser button.- Overrides:
getChooserOptionin classAbstractDataSettings<T extends AbstractCategorySettings<T>>- Parameters:
customOptionMap- Extra chooser options forwarded by the optionChooserConstants.EXTRA_CHOOSER_OPTIONand appended to the query string- Returns:
Stringrepresenting the options as query string
-
clone
public T clone() throws java.lang.CloneNotSupportedException
Description copied from interface:ControlSettingsClone the current ControlSettings.- Specified by:
clonein interfaceControlSettings<T extends AbstractCategorySettings<T>>- Overrides:
clonein 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 ofCategoryrepresenting 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 ofCategoryrepresenting 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-trueto display the root categories, insteadfalse- Returns:
- a reference to this object - used to chain calls
-
filter
public T filter(CategoryFilter filter)
Set theCategoryFilterin 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 asStringin order to filter the categories to display.
Thefilterparameter accepts one of the names corresponding to theCategoryFilterenum constants.
Thefilterparameter can be in lower case or upper case.- Parameters:
filter- the name of theCategoryFilterenum 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
-
-