org.opencms.widgets
Class A_CmsHtmlWidget

java.lang.Object
  extended by org.opencms.widgets.A_CmsWidget
      extended by org.opencms.widgets.A_CmsHtmlWidget
All Implemented Interfaces:
I_CmsWidget
Direct Known Subclasses:
CmsHtmlWidget

public abstract class A_CmsHtmlWidget
extends A_CmsWidget

Provides a widget that creates a rich input field using the matching component, for use on a widget dialog.

The matching component is determined by checking the installed editors for the best matching component to use.

Since:
6.0.1
Version:
$Revision: 1.10 $
Author:
Andreas Zahner

Field Summary
 
Fields inherited from class org.opencms.widgets.A_CmsWidget
HELP_POSTFIX, LABEL_PREFIX
 
Constructor Summary
A_CmsHtmlWidget()
          Creates a new html editing widget.
A_CmsHtmlWidget(CmsHtmlWidgetOption configuration)
          Creates a new html editing widget with the given configuration.
A_CmsHtmlWidget(java.lang.String configuration)
          Creates a new html editing widget with the given configuration.
 
Method Summary
protected  java.lang.String buildOpenCmsButtonRow(I_CmsWidgetDialog widgetDialog, java.lang.String paramId)
          Returns the HTML for the OpenCms specific button row for galleries and links.
protected  java.lang.String buildOpenCmsButtonRow(int segment, I_CmsWidgetDialog widgetDialog)
          Returns the start or end HTML for the OpenCms specific button row.
 java.lang.String getConfiguration()
          Returns the configuration string.
 CmsHtmlWidgetOption getHtmlWidgetOption()
          Returns the configured Html widget options.
 void setConfiguration(java.lang.String configuration)
          Sets the configuration of this widget.
 void setEditorValue(CmsObject cms, java.util.Map 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.
 void setHtmlWidgetOption(CmsHtmlWidgetOption htmlWidgetOption)
          Sets the configured Html widget options.
 
Methods inherited from class org.opencms.widgets.A_CmsWidget
equals, getDialogHtmlEnd, getDialogIncludes, getDialogInitCall, getDialogInitMethod, getHelpBubble, getHelpKey, getHelpText, getJsHelpMouseHandler, getJSIncludeFile, getLabelKey, getWidgetStringValue, hashCode
 
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
getDialogWidget, newInstance
 

Constructor Detail

A_CmsHtmlWidget

public A_CmsHtmlWidget()
Creates a new html editing widget.


A_CmsHtmlWidget

public A_CmsHtmlWidget(CmsHtmlWidgetOption configuration)
Creates a new html editing widget with the given configuration.

Parameters:
configuration - the configuration to use

A_CmsHtmlWidget

public A_CmsHtmlWidget(java.lang.String configuration)
Creates a new html editing widget with the given configuration.

Parameters:
configuration - the configuration to use
Method Detail

getConfiguration

public java.lang.String getConfiguration()
Description copied from class: A_CmsWidget
Returns the configuration string.

Specified by:
getConfiguration in interface I_CmsWidget
Overrides:
getConfiguration in class A_CmsWidget
Returns:
the configuration string
See Also:
A_CmsWidget.getConfiguration()

getHtmlWidgetOption

public CmsHtmlWidgetOption getHtmlWidgetOption()
Returns the configured Html widget options.

Returns:
the configured Html widget options

setConfiguration

public void setConfiguration(java.lang.String configuration)
Description copied from interface: I_CmsWidget
Sets 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:
setConfiguration in interface I_CmsWidget
Overrides:
setConfiguration in class A_CmsWidget
Parameters:
configuration - the configuration to set
See Also:
I_CmsWidget.setConfiguration(java.lang.String)

setEditorValue

public void setEditorValue(CmsObject cms,
                           java.util.Map formParameters,
                           I_CmsWidgetDialog widgetDialog,
                           I_CmsWidgetParameter param)
Description copied from interface: I_CmsWidget
Sets the value of in the given widget parameter by reading the "right" value from the offered map of parameters.

Specified by:
setEditorValue in interface I_CmsWidget
Overrides:
setEditorValue in class A_CmsWidget
Parameters:
cms - the current users OpenCms context
formParameters - the map of parameters to get the value from
widgetDialog - the dialog where the widget is used on
param - the widget parameter to generate the widget for
See Also:
I_CmsWidget.setEditorValue(org.opencms.file.CmsObject, java.util.Map, org.opencms.widgets.I_CmsWidgetDialog, org.opencms.widgets.I_CmsWidgetParameter)

setHtmlWidgetOption

public void setHtmlWidgetOption(CmsHtmlWidgetOption htmlWidgetOption)
Sets the configured Html widget options.

Parameters:
htmlWidgetOption - the configured Html widget options

buildOpenCmsButtonRow

protected java.lang.String buildOpenCmsButtonRow(I_CmsWidgetDialog widgetDialog,
                                                 java.lang.String paramId)
Returns the HTML for the OpenCms specific button row for galleries and links.

Use this method to generate a button row with OpenCms specific dialog buttons in the I_CmsWidget.getDialogWidget(org.opencms.file.CmsObject, org.opencms.widgets.I_CmsWidgetDialog, org.opencms.widgets.I_CmsWidgetParameter) method to obtain the buttons.

Overwrite the method if the integrated editor needs a specific button generation (e.g. add format select or toggle source code button) or if some buttons should not be available.

Parameters:
widgetDialog - the dialog where the widget is used on
paramId - the id of the current widget
Returns:
the html String for the OpenCms specific button row

buildOpenCmsButtonRow

protected java.lang.String buildOpenCmsButtonRow(int segment,
                                                 I_CmsWidgetDialog widgetDialog)
Returns the start or end HTML for the OpenCms specific button row.

Use this method to generate the start and end html for the button row.

Overwrite the method if the integrated editor needs a specific layout for the button row start or end html.

Parameters:
segment - the HTML segment (START / END)
widgetDialog - the dialog where the widget is used on
Returns:
the html String for the OpenCms specific button row