public abstract class A_CmsSelectWidget extends A_CmsWidget implements I_CmsADEWidget
CmsSelectWidgetOption
A_CmsWidget.CmsDummyWidgetDialog
限定符和类型 | 字段和说明 |
---|---|
static java.lang.String |
CONFIGURATION_HEIGHT
Configuration parameter to set the height from the select widget in pixel.
|
HELP_POSTFIX, LABEL_PREFIX
构造器和说明 |
---|
A_CmsSelectWidget()
Creates a new select widget.
|
A_CmsSelectWidget(java.util.List<CmsSelectWidgetOption> configuration)
Creates a select widget with the select options specified in the given configuration List.
|
A_CmsSelectWidget(java.lang.String configuration)
Creates a select widget with the select options specified in the given configuration String.
|
限定符和类型 | 方法和说明 |
---|---|
void |
addSelectOption(CmsSelectWidgetOption option)
Adds a new select option to this widget.
|
java.lang.String |
getConfiguration()
Returns the configuration string.
|
java.lang.String |
getConfiguration(CmsObject cms,
A_CmsXmlContentValue schemaType,
CmsMessages messages,
CmsResource resource,
java.util.Locale contentLocale)
Returns the configuration string for the ADE content editor widget.
|
java.util.List<java.lang.String> |
getCssResourceLinks(CmsObject cms)
Returns a list of CSS resources required by the widget.
|
I_CmsXmlContentHandler.DisplayType |
getDefaultDisplayType()
Returns the default display type of this widget.
|
protected java.lang.String |
getHeight()
Gets the configured select widget height.
|
java.lang.String |
getInitCall()
Returns the java script initialization call.
|
java.util.List<java.lang.String> |
getJavaScriptResourceLinks(CmsObject cms)
Returns a list of java script resources required by the widget.
|
protected java.lang.String |
getResourcePath(CmsObject cms,
I_CmsWidgetDialog dialog)
Gets the resource path for the given dialog.
|
protected java.lang.String |
getSelectedValue(CmsObject cms,
I_CmsWidgetParameter param)
Returns the currently selected value of the select widget.
|
protected java.util.List<java.lang.String> |
getSelectedValues(CmsObject cms,
I_CmsWidgetParameter param)
Returns the currently selected values of the select widget.
|
protected java.util.List<CmsSelectWidgetOption> |
getSelectOptions()
Returns the list of configured select options.
|
java.lang.String |
getWidgetName()
Returns the class name of the widget.
|
boolean |
isInternal()
Returns if this is an internal widget.
|
protected java.util.List<CmsSelectWidgetOption> |
parseSelectOptions(CmsObject cms,
I_CmsWidgetDialog widgetDialog,
I_CmsWidgetParameter param)
Returns the list of configured select options, parsing the configuration String if required.
|
void |
setConfiguration(java.lang.String configuration)
Sets the configuration of this widget.
|
protected void |
setSelectOptions(java.util.List<CmsSelectWidgetOption> selectOptions)
Sets the list of configured select options.
|
equals, getDialogHtmlEnd, getDialogIncludes, getDialogInitCall, getDialogInitMethod, getHelpBubble, getHelpKey, getHelpText, getJsHelpMouseHandler, getJSIncludeFile, getLabelKey, getWidgetStringValue, hashCode, isCompactViewEnabled, setEditorValue
getDialogHtmlEnd, getDialogIncludes, getDialogInitCall, getDialogInitMethod, getDialogWidget, getHelpBubble, getHelpText, getWidgetStringValue, isCompactViewEnabled, newInstance, setEditorValue
public static final java.lang.String CONFIGURATION_HEIGHT
public A_CmsSelectWidget()
public A_CmsSelectWidget(java.util.List<CmsSelectWidgetOption> configuration)
The list elements must be of type
.CmsSelectWidgetOption
configuration
- the configuration (possible options) for the select widgetCmsSelectWidgetOption
public A_CmsSelectWidget(java.lang.String configuration)
Please see
for a description of the syntax
of the configuration String.CmsSelectWidgetOption
configuration
- the configuration (possible options) for the select widgetCmsSelectWidgetOption
public void addSelectOption(CmsSelectWidgetOption option)
option
- the select option to addpublic java.lang.String getConfiguration()
A_CmsWidget
getConfiguration
在接口中 I_CmsWidget
getConfiguration
在类中 A_CmsWidget
A_CmsWidget.getConfiguration()
public java.lang.String getConfiguration(CmsObject cms, A_CmsXmlContentValue schemaType, CmsMessages messages, CmsResource resource, java.util.Locale contentLocale)
I_CmsADEWidget
getConfiguration
在接口中 I_CmsADEWidget
cms
- the OpenCms contextschemaType
- the schema typemessages
- the messagesresource
- the edited resourcecontentLocale
- the content localeI_CmsADEWidget.getConfiguration(org.opencms.file.CmsObject, org.opencms.xml.types.A_CmsXmlContentValue, org.opencms.i18n.CmsMessages, org.opencms.file.CmsResource, java.util.Locale)
public java.util.List<java.lang.String> getCssResourceLinks(CmsObject cms)
getCssResourceLinks
在接口中 I_CmsADEWidget
cms
- the current OpenCms contextpublic I_CmsXmlContentHandler.DisplayType getDefaultDisplayType()
I_CmsADEWidget
getDefaultDisplayType
在接口中 I_CmsADEWidget
I_CmsADEWidget.getDefaultDisplayType()
public java.lang.String getInitCall()
getInitCall
在接口中 I_CmsADEWidget
public java.util.List<java.lang.String> getJavaScriptResourceLinks(CmsObject cms)
getJavaScriptResourceLinks
在接口中 I_CmsADEWidget
cms
- the current OpenCms contextpublic java.lang.String getWidgetName()
I_CmsADEWidget
getWidgetName
在接口中 I_CmsADEWidget
I_CmsADEWidget.getWidgetName()
public boolean isInternal()
Only widgets belonging to the OpenCms core should be marked as internal.
isInternal
在接口中 I_CmsADEWidget
true
if this is an internal widgetpublic void setConfiguration(java.lang.String configuration)
I_CmsWidget
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.
setConfiguration
在接口中 I_CmsWidget
setConfiguration
在类中 A_CmsWidget
configuration
- the configuration to setA_CmsWidget.setConfiguration(java.lang.String)
protected java.lang.String getHeight()
protected java.lang.String getResourcePath(CmsObject cms, I_CmsWidgetDialog dialog)
cms
- TODOdialog
- the dialogprotected java.lang.String getSelectedValue(CmsObject cms, I_CmsWidgetParameter param)
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, null
is returned.
cms
- the current users OpenCms contextparam
- the widget parameter of this dialogprotected java.util.List<java.lang.String> getSelectedValues(CmsObject cms, I_CmsWidgetParameter param)
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, null
is used.
cms
- the current users OpenCms contextparam
- the widget parameter of this dialogprotected java.util.List<CmsSelectWidgetOption> getSelectOptions()
The list elements are of type
.CmsSelectWidgetOption
protected java.util.List<CmsSelectWidgetOption> parseSelectOptions(CmsObject cms, I_CmsWidgetDialog widgetDialog, I_CmsWidgetParameter param)
The list elements are of type
.
The configuration String is parsed only once and then stored internally.CmsSelectWidgetOption
cms
- the current users OpenCms contextwidgetDialog
- the dialog of this widgetparam
- the widget parameter of this dialogCmsSelectWidgetOption
protected void setSelectOptions(java.util.List<CmsSelectWidgetOption> selectOptions)
The list elements must be of type
.CmsSelectWidgetOption
selectOptions
- the list of select options to set