Package org.opencms.widgets
Class A_CmsFormatterWidget
java.lang.Object
org.opencms.widgets.A_CmsWidget
org.opencms.widgets.A_CmsSelectWidget
org.opencms.widgets.CmsSelectWidget
org.opencms.widgets.A_CmsFormatterWidget
- All Implemented Interfaces:
I_CmsADEWidget
,I_CmsWidget
- Direct Known Subclasses:
CmsAddFormatterWidget
,CmsRemoveFormatterWidget
Abstract superclass for widgets used to enable or disable formatters.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Comparator used to sort formatter beans in the order in which they should be displayed in the selection.Nested classes/interfaces inherited from class org.opencms.widgets.A_CmsWidget
A_CmsWidget.CmsDummyWidgetDialog
-
Field Summary
Modifier and TypeFieldDescriptionprotected static final org.apache.commons.logging.Log
The logger instance for this class.Fields inherited from class org.opencms.widgets.A_CmsSelectWidget
CONFIGURATION_HEIGHT
Fields inherited from class org.opencms.widgets.A_CmsWidget
HELP_POSTFIX, LABEL_PREFIX
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetConfiguration
(CmsObject cms, A_CmsXmlContentValue schemaType, CmsMessages messages, CmsResource resource, Locale contentLocale) Returns the configuration string for the ADE content editor widget.protected abstract List<CmsSelectWidgetOption>
getFormatterOptions
(CmsObject cms, CmsADEConfigData config, String rootPath, boolean allRemoved) Gets the options corresponding to external (non-schema) formatters.getSelectedInFile
(CmsConfigurationReader reader, CmsXmlContent content) Gets the values which have already been selected in the edited resource on the VFS.protected abstract List<CmsSelectWidgetOption>
getTypeOptions
(CmsObject cms, CmsADEConfigData config, boolean allRemoved) Gets the options corresponding to the schemas which define formatters.Returns the class name of the widget.static CmsSelectWidgetOption
getWidgetOptionForFormatter
(CmsObject cms, I_CmsFormatterBean formatter) Creates a widget option corresponding to a formatter bean for an external formatter.static CmsSelectWidgetOption
getWidgetOptionForType
(CmsObject cms, String typeName) Creates a widget option for a resource type.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.protected List<CmsSelectWidgetOption>
parseSelectOptions
(CmsObject cms, I_CmsWidgetDialog widgetDialog, I_CmsWidgetParameter param, boolean allRemoved) Returns the list of configured select options, parsing the configuration String if required.Methods inherited from class org.opencms.widgets.CmsSelectWidget
getDialogWidget, getWidgetStringValue, newInstance
Methods inherited from class org.opencms.widgets.A_CmsSelectWidget
addSelectOption, getConfiguration, getCssResourceLinks, getDefaultDisplayType, getHeight, getInitCall, getJavaScriptResourceLinks, getResourcePath, getSelectedValue, getSelectedValues, getSelectOptions, isInternal, setConfiguration, setSelectOptions
Methods inherited from class org.opencms.widgets.A_CmsWidget
equals, getDialogHtmlEnd, getDialogIncludes, getDialogInitCall, getDialogInitMethod, getHelpBubble, getHelpKey, getHelpText, getJsHelpMouseHandler, getJSIncludeFile, getLabelKey, hashCode, isCompactViewEnabled, setEditorValue
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.opencms.widgets.I_CmsWidget
getDialogHtmlEnd, getDialogIncludes, getDialogInitCall, getDialogInitMethod, getHelpBubble, getHelpText, isCompactViewEnabled, setEditorValue
-
Field Details
-
LOG
The logger instance for this class.
-
-
Constructor Details
-
A_CmsFormatterWidget
public A_CmsFormatterWidget()
-
-
Method Details
-
getWidgetOptionForFormatter
public static CmsSelectWidgetOption getWidgetOptionForFormatter(CmsObject cms, I_CmsFormatterBean formatter) throws Exception Creates a widget option corresponding to a formatter bean for an external formatter.- Parameters:
cms
- the current CMS contextformatter
- the formatter bean- Returns:
- the select option which was created
- Throws:
Exception
- in case reading the formatter configuration file fails
-
getWidgetOptionForType
Creates a widget option for a resource type.- Parameters:
cms
- the current CMS contexttypeName
- the type for which we want a widget option- Returns:
- the created widget option
-
getConfiguration
public String getConfiguration(CmsObject cms, A_CmsXmlContentValue schemaType, CmsMessages messages, CmsResource resource, Locale contentLocale) Description copied from interface:I_CmsADEWidget
Returns the configuration string for the ADE content editor widget.- Specified by:
getConfiguration
in interfaceI_CmsADEWidget
- Overrides:
getConfiguration
in classA_CmsSelectWidget
- Parameters:
cms
- the OpenCms contextschemaType
- the schema typemessages
- the messagesresource
- the edited resourcecontentLocale
- the content locale- Returns:
- the configuration string
- See Also:
-
getWidgetName
Description copied from interface:I_CmsADEWidget
Returns the class name of the widget.- Specified by:
getWidgetName
in interfaceI_CmsADEWidget
- Overrides:
getWidgetName
in classCmsSelectWidget
- Returns:
- the class name
- See Also:
-
getFormatterOptions
protected abstract List<CmsSelectWidgetOption> getFormatterOptions(CmsObject cms, CmsADEConfigData config, String rootPath, boolean allRemoved) Gets the options corresponding to external (non-schema) formatters.- Parameters:
cms
- the CMS contextconfig
- the ADE configurationrootPath
- the root path of the edited fileallRemoved
- flag, indicating if all inheritedly available formatters should be disabled- Returns:
- the select widget options for the external formatters
-
getSelectedInFile
protected abstract Set<String> getSelectedInFile(CmsConfigurationReader reader, CmsXmlContent content) Gets the values which have already been selected in the edited resource on the VFS.- Parameters:
reader
- a sitemap configuration readercontent
- the unmarshalled content- Returns:
- the set of values which have already been selected
-
getTypeOptions
protected abstract List<CmsSelectWidgetOption> getTypeOptions(CmsObject cms, CmsADEConfigData config, boolean allRemoved) Gets the options corresponding to the schemas which define formatters.- Parameters:
cms
- the current CMS contextconfig
- the ADE configurationallRemoved
- flag, indicating if all inheritedly available formatters should be disabled- Returns:
- the select widget options for the content types with formatters in the schema
-
parseSelectOptions
protected List<CmsSelectWidgetOption> parseSelectOptions(CmsObject cms, I_CmsWidgetDialog widgetDialog, I_CmsWidgetParameter param) Description copied from class:A_CmsSelectWidget
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
- Overrides:
parseSelectOptions
in classA_CmsSelectWidget
- 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:
-
parseSelectOptions
protected List<CmsSelectWidgetOption> parseSelectOptions(CmsObject cms, I_CmsWidgetDialog widgetDialog, I_CmsWidgetParameter param, boolean allRemoved) 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 dialogallRemoved
- flag, indicating if all inheritedly available formatters should be disabled- Returns:
- the list of select options
- See Also:
-