Package org.opencms.widgets
Class A_CmsWidget
java.lang.Object
org.opencms.widgets.A_CmsWidget
- All Implemented Interfaces:
I_CmsWidget
- Direct Known Subclasses:
A_CmsAdeGalleryWidget,A_CmsCategorizedSelectWidget,A_CmsGalleryWidget,A_CmsHtmlWidget,A_CmsSelectWidget,CmsCalendarWidget,CmsCategoryWidget,CmsCheckboxWidget,CmsCodeWidget,CmsColorpickerWidget,CmsDisplayWidget,CmsGroupWidget,CmsHttpUploadWidget,CmsInputWidget,CmsLocalizationWidget,CmsLocationPickerWidget,CmsPasswordWidget,CmsPrincipalWidget,CmsSerialDateWidget,CmsTextareaWidget,CmsVfsFileWidget
Base class for XML editor widgets.
- Since:
- 6.0.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassInner class to generate the I_CmsWidgetDialog. -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDefault constructor.protectedA_CmsWidget(String configuration) Constructor for preprocessing the configuration string. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the configuration string.getDialogHtmlEnd(CmsObject cms, I_CmsWidgetDialog widgetDialog, I_CmsWidgetParameter value) Generates the html to include at the end of the dialog for this widget.getDialogIncludes(CmsObject cms, I_CmsWidgetDialog widgetDialog) Generates the necessary JavaScript inclusion code for this widget.getDialogInitCall(CmsObject cms, I_CmsWidgetDialog widgetDialog) Generates the initialisation method JavaScript code for this widget.getDialogInitMethod(CmsObject cms, I_CmsWidgetDialog widgetDialog) Generates the initialization method JavaScript code for this widget.getHelpBubble(CmsObject cms, I_CmsWidgetDialog widgetDialog, I_CmsWidgetParameter param) Creates the HTML code for the help bubble for this widget.static StringgetHelpKey(I_CmsWidgetParameter param) Returns the localized help key for the provided widget parameter.getHelpText(I_CmsWidgetDialog widgetDialog, I_CmsWidgetParameter param) Creates a HTML <div> containing the help text for this widget.protected StringgetJsHelpMouseHandler(I_CmsWidgetDialog widgetDialog, String key, String value) Returns the HTML for the JavaScript mouse handlers that show / hide the help text.protected StringgetJSIncludeFile(String fileName) Creates the tags to include external javascript files.static StringgetLabelKey(I_CmsWidgetParameter param) Returns the localized label key for the provided widget parameter.getWidgetStringValue(CmsObject cms, I_CmsWidgetDialog widgetDialog, I_CmsWidgetParameter param) Returns theprocessed according to the output rules of this widget and the given widget dialog.I_CmsWidgetParameter.getStringValue(CmsObject)inthashCode()booleanReturns if the widget is compact view enabled.voidsetConfiguration(String configuration) Sets the configuration of this widget.voidsetEditorValue(CmsObject cms, Map<String, String[]> formParameters, I_CmsWidgetDialog widgetDialog, I_CmsWidgetParameter param) Sets the value of in the given widget parameter by reading the "right" value from the offered map of parameters.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.opencms.widgets.I_CmsWidget
getDialogWidget, newInstance
-
Field Details
-
HELP_POSTFIX
Postfix for melp message locale.- See Also:
-
LABEL_PREFIX
Prefix for message locales.- See Also:
-
-
Constructor Details
-
A_CmsWidget
protected A_CmsWidget()Default constructor. -
A_CmsWidget
Constructor for preprocessing the configuration string.- Parameters:
configuration- the configuration string
-
-
Method Details
-
getHelpKey
Returns the localized help key for the provided widget parameter.- Parameters:
param- the widget parameter to return the localized help key for- Returns:
- the localized help key for the provided widget parameter
-
getLabelKey
Returns the localized label key for the provided widget parameter.- Parameters:
param- the widget parameter to return the localized label key for- Returns:
- the localized label key for the provided widget parameter
-
equals
-
getConfiguration
Returns the configuration string.- Specified by:
getConfigurationin interfaceI_CmsWidget- Returns:
- the configuration string
-
getDialogHtmlEnd
public String getDialogHtmlEnd(CmsObject cms, I_CmsWidgetDialog widgetDialog, I_CmsWidgetParameter value) Description copied from interface:I_CmsWidgetGenerates the html to include at the end of the dialog for this widget.The "help bubble" text div's are added using this method.
- Specified by:
getDialogHtmlEndin interfaceI_CmsWidget- Parameters:
cms- the current users OpenCms contextwidgetDialog- the dialog where the widget is used onvalue- the widget parameter to generate the widget for- Returns:
- the html to include at the end of the dialog for this widget
- See Also:
-
getDialogIncludes
Description copied from interface:I_CmsWidgetGenerates the necessary JavaScript inclusion code for this widget.- Specified by:
getDialogIncludesin interfaceI_CmsWidget- Parameters:
cms- the current users OpenCms contextwidgetDialog- the dialog where the widget is used on- Returns:
- the JavaScript inclusion code
- See Also:
-
getDialogInitCall
Description copied from interface:I_CmsWidgetGenerates the initialisation method JavaScript code for this widget.- Specified by:
getDialogInitCallin interfaceI_CmsWidget- Parameters:
cms- the current users OpenCms contextwidgetDialog- the dialog where the widget is used on- Returns:
- the initialisation method JavaScript code
- See Also:
-
getDialogInitMethod
Description copied from interface:I_CmsWidgetGenerates the initialization method JavaScript code for this widget.- Specified by:
getDialogInitMethodin interfaceI_CmsWidget- Parameters:
cms- an initialized instance of a CmsObjectwidgetDialog- the dialog where the widget is used on- Returns:
- the initialization method JavaScript code
- See Also:
-
getHelpBubble
public String getHelpBubble(CmsObject cms, I_CmsWidgetDialog widgetDialog, I_CmsWidgetParameter param) Description copied from interface:I_CmsWidgetCreates the HTML code for the help bubble for this widget.- Specified by:
getHelpBubblein interfaceI_CmsWidget- Parameters:
cms- the current users OpenCms contextwidgetDialog- the dialog where the widget is used onparam- the widget parameter to generate the widget for- Returns:
- the HTML code for the help bubble for this widget
- See Also:
-
getHelpText
Description copied from interface:I_CmsWidgetCreates a HTML <div> containing the help text for this widget.- Specified by:
getHelpTextin interfaceI_CmsWidget- Parameters:
widgetDialog- the dialog where the widget is used onparam- the value to create the help bubble for- Returns:
- a HTML <div> containing the help text for this widget
- See Also:
-
getWidgetStringValue
public String getWidgetStringValue(CmsObject cms, I_CmsWidgetDialog widgetDialog, I_CmsWidgetParameter param) Description copied from interface:I_CmsWidgetReturns theprocessed according to the output rules of this widget and the given widget dialog.I_CmsWidgetParameter.getStringValue(CmsObject)- Specified by:
getWidgetStringValuein interfaceI_CmsWidget- Parameters:
cms- the current users OpenCms contextwidgetDialog- the dialog where the widget is used onparam- the widget parameter to generate the widget for- Returns:
- the
processed according to the output rules of this widgetI_CmsWidgetParameter.getStringValue(CmsObject) - See Also:
-
hashCode
-
isCompactViewEnabled
Description copied from interface:I_CmsWidgetReturns if the widget is compact view enabled.- Specified by:
isCompactViewEnabledin interfaceI_CmsWidget- Returns:
trueif the widget is compact view enabled- See Also:
-
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- Parameters:
configuration- the configuration to set- See Also:
-
setEditorValue
public void setEditorValue(CmsObject cms, Map<String, String[]> formParameters, I_CmsWidgetDialog widgetDialog, I_CmsWidgetParameter param) Description copied from interface:I_CmsWidgetSets the value of in the given widget parameter by reading the "right" value from the offered map of parameters.- Specified by:
setEditorValuein interfaceI_CmsWidget- Parameters:
cms- the current users OpenCms contextformParameters- the map of parameters to get the value fromwidgetDialog- the dialog where the widget is used onparam- the widget parameter to generate the widget for- See Also:
-
getJsHelpMouseHandler
Returns the HTML for the JavaScript mouse handlers that show / hide the help text.This is required since the handler differs between the "Dialog" and the "Administration" mode.
- Parameters:
widgetDialog- the dialog where the widget is displayed onkey- the key for the help bubblevalue- the localized help text, has to be an escaped String for JS usage, is only used in XML content editor- Returns:
- the HTML for the JavaScript mouse handlers that show / hide the help text
-
getJSIncludeFile
Creates the tags to include external javascript files.- Parameters:
fileName- the absolute path to the javascript file- Returns:
- the tags to include external javascript files
-