org.opencms.widgets
Class A_CmsSelectWidget

java.lang.Object
  extended byorg.opencms.widgets.A_CmsWidget
      extended byorg.opencms.widgets.A_CmsSelectWidget
All Implemented Interfaces:
I_CmsWidget
Direct Known Subclasses:
CmsComboWidget, CmsSelectWidget

public abstract class A_CmsSelectWidget
extends A_CmsWidget

Base class for select widgets.

Since:
6.0.0
Version:
$Revision: 1.5 $
Author:
Alexander Kandzior, Andreas Zahner
See Also:
CmsSelectWidgetOption

Constructor Summary
A_CmsSelectWidget()
          Creates a new select widget.
A_CmsSelectWidget(List configuration)
          Creates a select widget with the select options specified in the given configuration List.
A_CmsSelectWidget(String configuration)
          Creates a select widget with the select options specified in the given configuration String.
 
Method Summary
 void addSelectOption(CmsSelectWidgetOption option)
          Adds a new select option to this widget.
protected  String getConfiguration()
          Returns the configuration string.
protected  String getSelectedValue(CmsObject cms, I_CmsWidgetParameter param)
          Returns the currently selected value of the select widget.
protected  List getSelectOptions()
          Returns the list of configured select options.
protected  List parseSelectOptions(CmsObject cms, I_CmsWidgetDialog widgetDialog, I_CmsWidgetParameter param)
          Returns the list of configured select options, parsing the configuration String if required.
 
Methods inherited from class org.opencms.widgets.A_CmsWidget
equals, getDialogHtmlEnd, getDialogIncludes, getDialogInitCall, getDialogInitMethod, getHelpBubble, getHelpKey, getHelpText, getJsHelpMouseHandler, getJSIncludeFile, getLabelKey, hashCode, setConfiguration, setEditorValue
 
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_CmsSelectWidget

public A_CmsSelectWidget()
Creates a new select widget.


A_CmsSelectWidget

public A_CmsSelectWidget(List configuration)
Creates a select widget with the select options specified in the given configuration List.

The list elements must be of type CmsSelectWidgetOption.

Parameters:
configuration - the configuration (possible options) for the select widget
See Also:
CmsSelectWidgetOption

A_CmsSelectWidget

public A_CmsSelectWidget(String configuration)
Creates a select widget with the select options specified in the given configuration String.

Please see CmsSelectWidgetOption for a description of the syntax of the configuration String.

Parameters:
configuration - the configuration (possible options) for the select widget
See Also:
CmsSelectWidgetOption
Method Detail

addSelectOption

public void addSelectOption(CmsSelectWidgetOption option)
Adds a new select option to this widget.

Parameters:
option - the select option to add

getConfiguration

protected String getConfiguration()
Description copied from class: A_CmsWidget
Returns the configuration string.

Overrides:
getConfiguration in class A_CmsWidget
Returns:
the configuration string
See Also:
A_CmsWidget.getConfiguration()

getSelectedValue

protected String getSelectedValue(CmsObject cms,
                                  I_CmsWidgetParameter param)
Returns the currently selected value of the select widget.

If a value is found in the given parameter, this is used. Otherwise the default value of the select options are used. If there is neither a parameter value nor a default value, null is returned.

Parameters:
cms - the current users OpenCms context
param - the widget parameter of this dialog
Returns:
the currently selected value of the select widget

getSelectOptions

protected List getSelectOptions()
Returns the list of configured select options.

The list elements are of type CmsSelectWidgetOption.

Returns:
the list of select options

parseSelectOptions

protected List parseSelectOptions(CmsObject cms,
                                  I_CmsWidgetDialog widgetDialog,
                                  I_CmsWidgetParameter param)
Returns the list of configured select options, parsing the configuration String if required.

The list elements are of type CmsSelectWidgetOption. The configuration String is parsed only once and then stored internally.

Parameters:
cms - the current users OpenCms context
widgetDialog - the dialog of this widget
param - the widget parameter of this dialog
Returns:
the list of select options
See Also:
CmsSelectWidgetOption