public abstract class A_CmsWidget extends java.lang.Object implements I_CmsWidget
| Modifier and Type | Class and Description |
|---|---|
class |
A_CmsWidget.CmsDummyWidgetDialog
Inner class to generate the I_CmsWidgetDialog.
|
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
HELP_POSTFIX
Postfix for melp message locale.
|
static java.lang.String |
LABEL_PREFIX
Prefix for message locales.
|
| Modifier | Constructor and Description |
|---|---|
protected |
A_CmsWidget()
Default constructor.
|
protected |
A_CmsWidget(java.lang.String configuration)
Constructor for preprocessing the configuration string.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj) |
java.lang.String |
getConfiguration()
Returns the configuration string.
|
java.lang.String |
getDialogHtmlEnd(CmsObject cms,
I_CmsWidgetDialog widgetDialog,
I_CmsWidgetParameter value)
Generates the html to include at the end of the dialog for this widget.
|
java.lang.String |
getDialogIncludes(CmsObject cms,
I_CmsWidgetDialog widgetDialog)
Generates the necessary JavaScript inclusion code for this widget.
|
java.lang.String |
getDialogInitCall(CmsObject cms,
I_CmsWidgetDialog widgetDialog)
Generates the initialisation method JavaScript code for this widget.
|
java.lang.String |
getDialogInitMethod(CmsObject cms,
I_CmsWidgetDialog widgetDialog)
Generates the initialization method JavaScript code for this widget.
|
java.lang.String |
getHelpBubble(CmsObject cms,
I_CmsWidgetDialog widgetDialog,
I_CmsWidgetParameter param)
Creates the HTML code for the help bubble for this widget.
|
static java.lang.String |
getHelpKey(I_CmsWidgetParameter param)
Returns the localized help key for the provided widget parameter.
|
java.lang.String |
getHelpText(I_CmsWidgetDialog widgetDialog,
I_CmsWidgetParameter param)
Creates a HTML <div> containing the help text for this widget.
|
protected java.lang.String |
getJsHelpMouseHandler(I_CmsWidgetDialog widgetDialog,
java.lang.String key,
java.lang.String value)
Returns the HTML for the JavaScript mouse handlers that show / hide the help text.
|
protected java.lang.String |
getJSIncludeFile(java.lang.String fileName)
Creates the tags to include external javascript files.
|
static java.lang.String |
getLabelKey(I_CmsWidgetParameter param)
Returns the localized label key for the provided widget parameter.
|
java.lang.String |
getWidgetStringValue(CmsObject cms,
I_CmsWidgetDialog widgetDialog,
I_CmsWidgetParameter param)
Returns the
processed according to the output rules of this widget and the given widget dialog. |
int |
hashCode() |
boolean |
isCompactViewEnabled()
Returns if the widget is compact view enabled.
|
void |
setConfiguration(java.lang.String configuration)
Sets the configuration of this widget.
|
void |
setEditorValue(CmsObject cms,
java.util.Map<java.lang.String,java.lang.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.
|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitgetDialogWidget, newInstancepublic static final java.lang.String HELP_POSTFIX
public static final java.lang.String LABEL_PREFIX
protected A_CmsWidget()
protected A_CmsWidget(java.lang.String configuration)
configuration - the configuration stringpublic static java.lang.String getHelpKey(I_CmsWidgetParameter param)
param - the widget parameter to return the localized help key forpublic static java.lang.String getLabelKey(I_CmsWidgetParameter param)
param - the widget parameter to return the localized label key forpublic boolean equals(java.lang.Object obj)
equals in class java.lang.ObjectObject.equals(java.lang.Object)public java.lang.String getConfiguration()
getConfiguration in interface I_CmsWidgetpublic java.lang.String getDialogHtmlEnd(CmsObject cms, I_CmsWidgetDialog widgetDialog, I_CmsWidgetParameter value)
I_CmsWidgetThe "help bubble" text div's are added using this method.
getDialogHtmlEnd in interface I_CmsWidgetcms - the current users OpenCms contextwidgetDialog - the dialog where the widget is used onvalue - the widget parameter to generate the widget forI_CmsWidget.getDialogHtmlEnd(org.opencms.file.CmsObject, I_CmsWidgetDialog, I_CmsWidgetParameter)public java.lang.String getDialogIncludes(CmsObject cms, I_CmsWidgetDialog widgetDialog)
I_CmsWidgetgetDialogIncludes in interface I_CmsWidgetcms - the current users OpenCms contextwidgetDialog - the dialog where the widget is used onI_CmsWidget.getDialogIncludes(org.opencms.file.CmsObject, I_CmsWidgetDialog)public java.lang.String getDialogInitCall(CmsObject cms, I_CmsWidgetDialog widgetDialog)
I_CmsWidgetgetDialogInitCall in interface I_CmsWidgetcms - the current users OpenCms contextwidgetDialog - the dialog where the widget is used onI_CmsWidget.getDialogInitCall(org.opencms.file.CmsObject, I_CmsWidgetDialog)public java.lang.String getDialogInitMethod(CmsObject cms, I_CmsWidgetDialog widgetDialog)
I_CmsWidgetgetDialogInitMethod in interface I_CmsWidgetcms - an initialized instance of a CmsObjectwidgetDialog - the dialog where the widget is used onI_CmsWidget.getDialogInitMethod(org.opencms.file.CmsObject, org.opencms.widgets.I_CmsWidgetDialog)public java.lang.String getHelpBubble(CmsObject cms, I_CmsWidgetDialog widgetDialog, I_CmsWidgetParameter param)
I_CmsWidgetgetHelpBubble in interface I_CmsWidgetcms - the current users OpenCms contextwidgetDialog - the dialog where the widget is used onparam - the widget parameter to generate the widget forI_CmsWidget.getHelpBubble(org.opencms.file.CmsObject, I_CmsWidgetDialog, I_CmsWidgetParameter)public java.lang.String getHelpText(I_CmsWidgetDialog widgetDialog, I_CmsWidgetParameter param)
I_CmsWidgetgetHelpText in interface I_CmsWidgetwidgetDialog - the dialog where the widget is used onparam - the value to create the help bubble forI_CmsWidget.getHelpText(I_CmsWidgetDialog, I_CmsWidgetParameter)public java.lang.String getWidgetStringValue(CmsObject cms, I_CmsWidgetDialog widgetDialog, I_CmsWidgetParameter param)
I_CmsWidgetI_CmsWidgetParameter.getStringValue(CmsObject)
processed according to the output rules of this widget and the given widget dialog.getWidgetStringValue in interface I_CmsWidgetcms - the current users OpenCms contextwidgetDialog - the dialog where the widget is used onparam - the widget parameter to generate the widget forI_CmsWidgetParameter.getStringValue(CmsObject)
processed according to the output rules of this widgetI_CmsWidget.getWidgetStringValue(org.opencms.file.CmsObject, org.opencms.widgets.I_CmsWidgetDialog, org.opencms.widgets.I_CmsWidgetParameter)public int hashCode()
hashCode in class java.lang.ObjectObject.hashCode()public boolean isCompactViewEnabled()
I_CmsWidgetisCompactViewEnabled in interface I_CmsWidgettrue if the widget is compact view enabledI_CmsWidget.isCompactViewEnabled()public void setConfiguration(java.lang.String configuration)
I_CmsWidgetThis 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 in interface I_CmsWidgetconfiguration - the configuration to setI_CmsWidget.setConfiguration(java.lang.String)public void setEditorValue(CmsObject cms, java.util.Map<java.lang.String,java.lang.String[]> formParameters, I_CmsWidgetDialog widgetDialog, I_CmsWidgetParameter param)
I_CmsWidgetsetEditorValue in interface I_CmsWidgetcms - 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 forI_CmsWidget.setEditorValue(org.opencms.file.CmsObject, java.util.Map, org.opencms.widgets.I_CmsWidgetDialog, org.opencms.widgets.I_CmsWidgetParameter)protected java.lang.String getJsHelpMouseHandler(I_CmsWidgetDialog widgetDialog, java.lang.String key, java.lang.String value)
This is required since the handler differs between the "Dialog" and the "Administration" mode.
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 editorprotected java.lang.String getJSIncludeFile(java.lang.String fileName)
fileName - the absolute path to the javascript file