Class A_CmsSelectWidget
- All Implemented Interfaces:
I_CmsADEWidget,I_CmsWidget
- Direct Known Subclasses:
CmsComboWidget,CmsMultiSelectWidget,CmsOrgUnitWidget,CmsRadioSelectWidget,CmsSelectWidget
- Since:
- 6.0.0
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.opencms.widgets.A_CmsWidget
A_CmsWidget.CmsDummyWidgetDialog -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringConfiguration parameter to set the height from the select widget in pixel.Fields inherited from class org.opencms.widgets.A_CmsWidget
HELP_POSTFIX, LABEL_PREFIX -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new select widget.A_CmsSelectWidget(String configuration) Creates a select widget with the select options specified in the given configuration String.A_CmsSelectWidget(List<CmsSelectWidgetOption> configuration) Creates a select widget with the select options specified in the given configuration List. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddSelectOption(CmsSelectWidgetOption option) Adds a new select option to this widget.Returns the configuration string.getConfiguration(CmsObject cms, A_CmsXmlContentValue schemaType, CmsMessages messages, CmsResource resource, Locale contentLocale) Returns the configuration string for the ADE content editor widget.Returns a list of CSS resources required by the widget.Returns the default display type of this widget.protected StringGets the configured select widget height.Returns the java script initialization call.Returns a list of java script resources required by the widget.protected StringgetResourcePath(CmsObject cms, I_CmsWidgetDialog dialog) Gets the resource path for the given dialog.protected StringgetSelectedValue(CmsObject cms, I_CmsWidgetParameter param) Returns the currently selected value of the select widget.getSelectedValues(CmsObject cms, I_CmsWidgetParameter param) Returns the currently selected values of the select widget.protected List<CmsSelectWidgetOption> Returns the list of configured select options.Returns the class name of the widget.booleanReturns if this is an internal widget.protected List<CmsSelectWidgetOption> parseSelectOptions(CmsObject cms, I_CmsWidgetDialog widgetDialog, I_CmsWidgetParameter param) Returns the list of configured select options, parsing the configuration String if required.voidsetConfiguration(String configuration) Sets the configuration of this widget.protected voidsetSelectOptions(List<CmsSelectWidgetOption> selectOptions) Sets the list of configured select options.Methods inherited from class org.opencms.widgets.A_CmsWidget
equals, getDialogHtmlEnd, getDialogIncludes, getDialogInitCall, getDialogInitMethod, getHelpBubble, getHelpKey, getHelpText, getJsHelpMouseHandler, getJSIncludeFile, getLabelKey, getWidgetStringValue, hashCode, isCompactViewEnabled, setEditorValueMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.opencms.widgets.I_CmsWidget
getDialogHtmlEnd, getDialogIncludes, getDialogInitCall, getDialogInitMethod, getDialogWidget, getHelpBubble, getHelpText, getWidgetStringValue, isCompactViewEnabled, newInstance, setEditorValue
-
Field Details
-
CONFIGURATION_HEIGHT
Configuration parameter to set the height from the select widget in pixel.- See Also:
-
-
Constructor Details
-
A_CmsSelectWidget
public A_CmsSelectWidget()Creates a new select widget. -
A_CmsSelectWidget
Creates a select widget with the select options specified in the given configuration List.The list elements must be of type
.CmsSelectWidgetOption- Parameters:
configuration- the configuration (possible options) for the select widget- See Also:
-
A_CmsSelectWidget
Creates a select widget with the select options specified in the given configuration String.Please see
for a description of the syntax of the configuration String.CmsSelectWidgetOption- Parameters:
configuration- the configuration (possible options) for the select widget- See Also:
-
-
Method Details
-
addSelectOption
Adds a new select option to this widget.- Parameters:
option- the select option to add
-
getConfiguration
Description copied from class:A_CmsWidgetReturns the configuration string.- Specified by:
getConfigurationin interfaceI_CmsWidget- Overrides:
getConfigurationin classA_CmsWidget- Returns:
- the configuration string
- See Also:
-
getConfiguration
public String getConfiguration(CmsObject cms, A_CmsXmlContentValue schemaType, CmsMessages messages, CmsResource resource, Locale contentLocale) Description copied from interface:I_CmsADEWidgetReturns the configuration string for the ADE content editor widget.- Specified by:
getConfigurationin interfaceI_CmsADEWidget- Parameters:
cms- the OpenCms contextschemaType- the schema typemessages- the messagesresource- the edited resourcecontentLocale- the content locale- Returns:
- the configuration string
- See Also:
-
getCssResourceLinks
Returns a list of CSS resources required by the widget.- Specified by:
getCssResourceLinksin interfaceI_CmsADEWidget- Parameters:
cms- the current OpenCms context- Returns:
- the required CSS resource links
-
getDefaultDisplayType
Description copied from interface:I_CmsADEWidgetReturns the default display type of this widget.- Specified by:
getDefaultDisplayTypein interfaceI_CmsADEWidget- Returns:
- the default display type
- See Also:
-
getInitCall
Returns the java script initialization call.- Specified by:
getInitCallin interfaceI_CmsADEWidget- Returns:
- the java script initialization call
-
getJavaScriptResourceLinks
Returns a list of java script resources required by the widget.- Specified by:
getJavaScriptResourceLinksin interfaceI_CmsADEWidget- Parameters:
cms- the current OpenCms context- Returns:
- the required java script resource links
-
getWidgetName
Description copied from interface:I_CmsADEWidgetReturns the class name of the widget.- Specified by:
getWidgetNamein interfaceI_CmsADEWidget- Returns:
- the class name
- See Also:
-
isInternal
Returns if this is an internal widget.Only widgets belonging to the OpenCms core should be marked as internal.
- Specified by:
isInternalin interfaceI_CmsADEWidget- Returns:
trueif this is an internal widget
-
setConfiguration
Description copied from interface:I_CmsWidgetSets the configuration of this widget.This can be used to enable / disable certain widget features that should not always be available, or to pass specific initialization information to the widget. It depends on the widget implementation on how this information is used.
- Specified by:
setConfigurationin interfaceI_CmsWidget- Overrides:
setConfigurationin classA_CmsWidget- Parameters:
configuration- the configuration to set- See Also:
-
getHeight
Gets the configured select widget height.- Returns:
- the configured select widget height
-
getResourcePath
Gets the resource path for the given dialog.- Parameters:
cms- TODOdialog- the dialog- Returns:
- the resource path
-
getSelectedValue
Returns the currently selected value of the select widget.If a value is found in the given parameter, this is used. Otherwise the default value of the select options are used. If there is neither a parameter value nor a default value,
nullis returned.- Parameters:
cms- the current users OpenCms contextparam- the widget parameter of this dialog- Returns:
- the currently selected value of the select widget
-
getSelectedValues
Returns the currently selected values of the select widget.If a value is found in the given parameter, this is used. Otherwise the default value of the select options are used. If there is neither a parameter value nor a default value,
nullis used.- Parameters:
cms- the current users OpenCms contextparam- the widget parameter of this dialog- Returns:
- a list of the currently selected values of the select widget
-
getSelectOptions
Returns the list of configured select options.The list elements are of type
.CmsSelectWidgetOption- Returns:
- the list of select options
-
parseSelectOptions
protected List<CmsSelectWidgetOption> parseSelectOptions(CmsObject cms, I_CmsWidgetDialog widgetDialog, I_CmsWidgetParameter param) Returns the list of configured select options, parsing the configuration String if required.The list elements are of type
. The configuration String is parsed only once and then stored internally.CmsSelectWidgetOption- Parameters:
cms- the current users OpenCms contextwidgetDialog- the dialog of this widgetparam- the widget parameter of this dialog- Returns:
- the list of select options
- See Also:
-
setSelectOptions
Sets the list of configured select options.The list elements must be of type
.CmsSelectWidgetOption- Parameters:
selectOptions- the list of select options to set
-