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.

If options are passed from XML content schema definitions as widget configuration options, the following syntax is used for defining the option values:

"height:400px,link,anchor,imagegallery,downloadgallery,formatselect,source"

Available options are:

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

Since:
6.0.1
Version:
$Revision: 1.2 $
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_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_HEIGHT
          Option for the "height" configuration.
static java.lang.String OPTION_LINK
          Option for the "link" dialog.
static java.lang.String OPTION_SOURCE
          Option for the "source" code mode.
 
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.util.List getDisplayGalleries()
          Returns the displayed gallery names.
 java.lang.String getEditorHeight()
          Returns the widget editor height.
protected  void parseOptions(java.lang.String configuration)
          Parses the given configuration String.
 void setDisplayGalleries(java.util.List displayGalleries)
          Sets the displayed gallery names.
 void setEditorHeight(java.lang.String editorHeight)
          Sets the widget editor height.
 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 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.
 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 showLinkDialog()
          Returns true if the link dialog button should be available.
 boolean showSourceEditor()
          Returns true if the source code button should be available.
 
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_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_HEIGHT

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

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
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

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

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

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

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

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

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

parseOptions

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

Parameters:
configuration - the configuration String to parse