|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opencms.widgets.A_CmsWidget
org.opencms.widgets.CmsCategoryWidget
public class CmsCategoryWidget
Provides a widget for a category based dependent select boxes.
Field Summary | |
---|---|
static java.lang.String |
CONFIGURATION_CATEGORY
Configuration parameter to set the category to display. |
static java.lang.String |
CONFIGURATION_ONLYLEAFS
Configuration parameter to set the 'only leaf' flag parameter. |
static java.lang.String |
CONFIGURATION_PROPERTY
Configuration parameter to set the 'property' parameter. |
Fields inherited from class org.opencms.widgets.A_CmsWidget |
---|
HELP_POSTFIX, LABEL_PREFIX |
Constructor Summary | |
---|---|
CmsCategoryWidget()
Creates a new category widget. |
|
CmsCategoryWidget(java.lang.String configuration)
Creates a category widget with the specified options. |
Method Summary | |
---|---|
protected java.lang.String |
buildSelectBox(java.lang.String baseId,
int level,
java.util.List options,
java.lang.String selected,
boolean hasError,
boolean last)
Generates html code for the category selection. |
java.lang.String |
getConfiguration()
Returns the configuration string. |
protected java.util.Locale |
getDefaultLocale(CmsObject cms,
java.lang.String resource)
Returns the default locale in the content of the given resource. |
java.lang.String |
getDialogIncludes(CmsObject cms,
I_CmsWidgetDialog widgetDialog)
Generates the necessary JavaScript inclusion code for this widget. |
java.lang.String |
getDialogWidget(CmsObject cms,
I_CmsWidgetDialog widgetDialog,
I_CmsWidgetParameter param)
Generates the widget HTML for the provided widget parameter. |
protected CmsResource |
getResource(CmsObject cms,
I_CmsWidgetParameter param)
Returns the right resource, depending on the locale. |
protected java.lang.String |
getStartingCategory(CmsObject cms,
java.lang.String referencePath)
Returns the starting category depending on the configuration options. |
boolean |
isOnlyLeafs()
Check if only leaf selection is allowed. |
I_CmsWidget |
newInstance()
Creates a duplicate of this widget instance. |
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. |
Methods inherited from class org.opencms.widgets.A_CmsWidget |
---|
equals, getDialogHtmlEnd, 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 |
Field Detail |
---|
public static final java.lang.String CONFIGURATION_CATEGORY
public static final java.lang.String CONFIGURATION_ONLYLEAFS
public static final java.lang.String CONFIGURATION_PROPERTY
Constructor Detail |
---|
public CmsCategoryWidget()
public CmsCategoryWidget(java.lang.String configuration)
configuration
- the configuration for the widgetMethod Detail |
---|
public java.lang.String getConfiguration()
A_CmsWidget
getConfiguration
in interface I_CmsWidget
getConfiguration
in class A_CmsWidget
A_CmsWidget.getConfiguration()
public java.lang.String getDialogIncludes(CmsObject cms, I_CmsWidgetDialog widgetDialog)
I_CmsWidget
getDialogIncludes
in interface I_CmsWidget
getDialogIncludes
in class A_CmsWidget
cms
- the current users OpenCms contextwidgetDialog
- the dialog where the widget is used on
I_CmsWidget.getDialogIncludes(org.opencms.file.CmsObject, org.opencms.widgets.I_CmsWidgetDialog)
public void setEditorValue(CmsObject cms, java.util.Map formParameters, I_CmsWidgetDialog widgetDialog, I_CmsWidgetParameter param)
I_CmsWidget
setEditorValue
in interface I_CmsWidget
setEditorValue
in class A_CmsWidget
cms
- 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 forA_CmsWidget.setEditorValue(org.opencms.file.CmsObject, java.util.Map, org.opencms.widgets.I_CmsWidgetDialog, org.opencms.widgets.I_CmsWidgetParameter)
public java.lang.String getDialogWidget(CmsObject cms, I_CmsWidgetDialog widgetDialog, I_CmsWidgetParameter param)
I_CmsWidget
cms
- an initialized instance of a CmsObjectwidgetDialog
- the dialog where the widget is used onparam
- the widget parameter to generate the widget for
I_CmsWidget.getDialogWidget(org.opencms.file.CmsObject, org.opencms.widgets.I_CmsWidgetDialog, org.opencms.widgets.I_CmsWidgetParameter)
public boolean isOnlyLeafs()
true
, if only leaf selection is allowedpublic I_CmsWidget newInstance()
I_CmsWidget
I_CmsWidget.newInstance()
public void setConfiguration(java.lang.String configuration)
I_CmsWidget
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.
setConfiguration
in interface I_CmsWidget
setConfiguration
in class A_CmsWidget
configuration
- the configuration to setA_CmsWidget.setConfiguration(java.lang.String)
protected java.lang.String buildSelectBox(java.lang.String baseId, int level, java.util.List options, java.lang.String selected, boolean hasError, boolean last)
baseId
- the widget idlevel
- the category deep leveloptions
- the list of CmsSelectWidgetOption
objectsselected
- the selected optionhasError
- if to display error messagelast
- if it is the last level
protected java.util.Locale getDefaultLocale(CmsObject cms, java.lang.String resource)
cms
- the cms contextresource
- the resource path to get the default locale for
protected CmsResource getResource(CmsObject cms, I_CmsWidgetParameter param)
cms
- the cms contextparam
- the widget parameter
protected java.lang.String getStartingCategory(CmsObject cms, java.lang.String referencePath)
cms
- the cms contextreferencePath
- the right resource path
|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |