org.opencms.widgets
Class CmsHtmlWidgetOption

java.lang.Object
  extended byorg.opencms.widgets.CmsHtmlWidgetOption

public class CmsHtmlWidgetOption
extends java.lang.Object

An option of a Html type widget.

Options can be defined for each element of the type OpenCmsHtml using the widget HtmlWidget. They have to be placed in the annotation section of a XSD describing an xml content. The configuration attribute in the layout node for the element must contain the activated options as a comma separated String value:

Available options are:

If an option key is not found in the configuration options, the corresponding button will be hidden in the editor widget.

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

Field Summary
static java.lang.String EDITOR_DEFAULTHEIGHT
          The editor widget default height to use.
static java.lang.String OPTION_ANCHOR
          Option for the "anchor" dialog.
static java.lang.String OPTION_CSS
          Option for the css style sheet VFS path to use in the widget area.
static java.lang.String OPTION_DELIMITER
          The delimiter to use in the configuration String.
static java.lang.String OPTION_FORMATSELECT
          Option for the "formatselect" selector.
static java.lang.String OPTION_FULLPAGE
          Option for the "fullpage" editor variant.
static java.lang.String OPTION_HEIGHT
          Option for the "height" configuration.
static java.lang.String OPTION_IMAGE
          Option for the "image" dialog.
static java.lang.String OPTION_LINK
          Option for the "link" dialog.
static java.lang.String OPTION_SOURCE
          Option for the "source" code mode.
static java.lang.String OPTION_STYLES
          Option for the styles XML VFS path to use in the widget area.
static java.lang.String OPTION_TABLE
          Option for the "table" dialog.
 
Constructor Summary
CmsHtmlWidgetOption()
          Creates a new empty html widget object object.
CmsHtmlWidgetOption(java.lang.String configuration)
          Creates a new html widget object object, configured by the given configuration String.
 
Method Summary
static java.lang.String createConfigurationString(CmsHtmlWidgetOption option)
          Returns a html widget configuration String created from the given html widget option.
 java.lang.String getCssPath()
          Returns the css style sheet VFS path to use in the widget area.
 java.util.List getDisplayGalleries()
          Returns the displayed gallery names.
 java.lang.String getEditorHeight()
          Returns the widget editor height.
 java.lang.String getStylesXmlPath()
          Returns the styles XML VFS path to use in the widget area.
 boolean isFullPage()
          Returns if the editor should be used in full page mode.
protected  void parseOptions(java.lang.String configuration)
          Parses the given configuration String.
 void setCssPath(java.lang.String cssPath)
          Sets the css style sheet VFS path to use in the widget area.
 void setDisplayGalleries(java.util.List displayGalleries)
          Sets the displayed gallery names.
 void setEditorHeight(java.lang.String editorHeight)
          Sets the widget editor height.
 void setFullPage(boolean fullPage)
          Sets if the editor should be used in full page mode.
 void setShowAnchorDialog(boolean showAnchorDialog)
          Sets if the anchor dialog button should be available.
 void setShowFormatSelect(boolean showFormatSelect)
          Sets if the format selector should be available.
 void setShowImageDialog(boolean showImageDialog)
          Sets if the image dialog button should be available.
 void setShowLinkDialog(boolean showLinkDialog)
          Sets if the link dialog button should be available.
 void setShowSourceEditor(boolean showSourceEditor)
          Sets if the source code button should be available.
 void setShowTableDialog(boolean showTableDialog)
          Sets if the table dialog button should be available.
 void setStylesXmlPath(java.lang.String stylesXmlPath)
          Sets the styles XML VFS path to use in the widget area.
 boolean showAnchorDialog()
          Returns true if the anchor dialog button should be available.
 boolean showFormatSelect()
          Returns true if the format selector should be available.
 boolean showGalleryDialog(java.lang.String galleryType)
          Returns true if the specified gallery type dialog button is shown.
 boolean showImageDialog()
          Returns true if the image dialog button should be available.
 boolean showLinkDialog()
          Returns true if the link dialog button should be available.
 boolean showSourceEditor()
          Returns true if the source code button should be available.
 boolean showStylesXml()
          Returns true if the styles selector should be available.
 boolean showTableDialog()
          Returns true if the table dialog button should be available.
 boolean useCss()
          Returns true if the widget editor should use a defined CSS style sheet.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EDITOR_DEFAULTHEIGHT

public static final java.lang.String EDITOR_DEFAULTHEIGHT
The editor widget default height to use.

See Also:
Constant Field Values

OPTION_ANCHOR

public static final java.lang.String OPTION_ANCHOR
Option for the "anchor" dialog.

See Also:
Constant Field Values

OPTION_CSS

public static final java.lang.String OPTION_CSS
Option for the css style sheet VFS path to use in the widget area.

See Also:
Constant Field Values

OPTION_DELIMITER

public static final java.lang.String OPTION_DELIMITER
The delimiter to use in the configuration String.

See Also:
Constant Field Values

OPTION_FORMATSELECT

public static final java.lang.String OPTION_FORMATSELECT
Option for the "formatselect" selector.

See Also:
Constant Field Values

OPTION_FULLPAGE

public static final java.lang.String OPTION_FULLPAGE
Option for the "fullpage" editor variant.

See Also:
Constant Field Values

OPTION_HEIGHT

public static final java.lang.String OPTION_HEIGHT
Option for the "height" configuration.

See Also:
Constant Field Values

OPTION_IMAGE

public static final java.lang.String OPTION_IMAGE
Option for the "image" dialog.

See Also:
Constant Field Values

OPTION_LINK

public static final java.lang.String OPTION_LINK
Option for the "link" dialog.

See Also:
Constant Field Values

OPTION_SOURCE

public static final java.lang.String OPTION_SOURCE
Option for the "source" code mode.

See Also:
Constant Field Values

OPTION_STYLES

public static final java.lang.String OPTION_STYLES
Option for the styles XML VFS path to use in the widget area.

See Also:
Constant Field Values

OPTION_TABLE

public static final java.lang.String OPTION_TABLE
Option for the "table" dialog.

See Also:
Constant Field Values
Constructor Detail

CmsHtmlWidgetOption

public CmsHtmlWidgetOption()
Creates a new empty html widget object object.


CmsHtmlWidgetOption

public CmsHtmlWidgetOption(java.lang.String configuration)
Creates a new html widget object object, configured by the given configuration String.

Parameters:
configuration - configuration String to parse
Method Detail

createConfigurationString

public static java.lang.String createConfigurationString(CmsHtmlWidgetOption option)
Returns a html widget configuration String created from the given html widget option.

Parameters:
option - the html widget options to create the configuration String for
Returns:
a select widget configuration String created from the given html widget option object

getCssPath

public java.lang.String getCssPath()
Returns the css style sheet VFS path to use in the widget area.

Returns:
the css style sheet VFS path to use in the widget area

getDisplayGalleries

public java.util.List getDisplayGalleries()
Returns the displayed gallery names.

Returns:
the displayed gallery names

getEditorHeight

public java.lang.String getEditorHeight()
Returns the widget editor height.

Returns:
the widget editor height

getStylesXmlPath

public java.lang.String getStylesXmlPath()
Returns the styles XML VFS path to use in the widget area.

Returns:
the styles XML VFS path to use in the widget area

isFullPage

public boolean isFullPage()
Returns if the editor should be used in full page mode.

Returns:
true if the editor should be used in full page mode, otherwise false

setCssPath

public void setCssPath(java.lang.String cssPath)
Sets the css style sheet VFS path to use in the widget area.

Parameters:
cssPath - the css style sheet VFS path to use in the widget area

setDisplayGalleries

public void setDisplayGalleries(java.util.List displayGalleries)
Sets the displayed gallery names.

Parameters:
displayGalleries - the displayed gallery names

setEditorHeight

public void setEditorHeight(java.lang.String editorHeight)
Sets the widget editor height.

Parameters:
editorHeight - the widget editor height

setFullPage

public void setFullPage(boolean fullPage)
Sets if the editor should be used in full page mode.

Parameters:
fullPage - true if the editor should be used in full page mode, otherwise false

setShowAnchorDialog

public void setShowAnchorDialog(boolean showAnchorDialog)
Sets if the anchor dialog button should be available.

Parameters:
showAnchorDialog - true if the anchor dialog button should be available, otherwise false

setShowFormatSelect

public void setShowFormatSelect(boolean showFormatSelect)
Sets if the format selector should be available.

Parameters:
showFormatSelect - true if the format selector should be available, otherwise false

setShowImageDialog

public void setShowImageDialog(boolean showImageDialog)
Sets if the image dialog button should be available.

Parameters:
showImageDialog - true if the image dialog button should be available, otherwise false

setShowLinkDialog

public void setShowLinkDialog(boolean showLinkDialog)
Sets if the link dialog button should be available.

Parameters:
showLinkDialog - true if the link dialog button should be available, otherwise false

setShowSourceEditor

public void setShowSourceEditor(boolean showSourceEditor)
Sets if the source code button should be available.

Parameters:
showSourceEditor - true if the source code button should be available, otherwise false

setShowTableDialog

public void setShowTableDialog(boolean showTableDialog)
Sets if the table dialog button should be available.

Parameters:
showTableDialog - true if the table dialog button should be available, otherwise false

setStylesXmlPath

public void setStylesXmlPath(java.lang.String stylesXmlPath)
Sets the styles XML VFS path to use in the widget area.

Parameters:
stylesXmlPath - the styles XML VFS path to use in the widget area

showAnchorDialog

public boolean showAnchorDialog()
Returns true if the anchor dialog button should be available.

Returns:
if the anchor dialog button should be available

showFormatSelect

public boolean showFormatSelect()
Returns true if the format selector should be available.

Returns:
if the format selector should be available

showGalleryDialog

public boolean showGalleryDialog(java.lang.String galleryType)
Returns true if the specified gallery type dialog button is shown.

Parameters:
galleryType - the gallery type to check
Returns:
true if the specified gallery type dialog button is shown, otherwise false

showImageDialog

public boolean showImageDialog()
Returns true if the image dialog button should be available.

Returns:
if the image dialog button should be available

showLinkDialog

public boolean showLinkDialog()
Returns true if the link dialog button should be available.

Returns:
if the link dialog button should be available

showSourceEditor

public boolean showSourceEditor()
Returns true if the source code button should be available.

Returns:
if the source code button should be available

showStylesXml

public boolean showStylesXml()
Returns true if the styles selector should be available.

Returns:
if the styles selector should be available

showTableDialog

public boolean showTableDialog()
Returns true if the table dialog button should be available.

Returns:
if the table dialog button should be available

useCss

public boolean useCss()
Returns true if the widget editor should use a defined CSS style sheet.

Returns:
if the widget editor should use a defined CSS style sheet

parseOptions

protected void parseOptions(java.lang.String configuration)
Parses the given configuration String.

Parameters:
configuration - the configuration String to parse