public class CmsCategoryWidget extends A_CmsWidget implements I_CmsADEWidget
A_CmsWidget.CmsDummyWidgetDialog| Modifier and Type | Field and Description |
|---|---|
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.
|
HELP_POSTFIX, LABEL_PREFIX| Constructor and Description |
|---|
CmsCategoryWidget()
Creates a new category widget.
|
CmsCategoryWidget(java.lang.String configuration)
Creates a category widget with the specified options.
|
| Modifier and Type | Method and Description |
|---|---|
protected java.lang.String |
buildSelectBox(java.lang.String baseId,
int level,
java.util.List<CmsSelectWidgetOption> options,
java.lang.String selected,
boolean hasError,
boolean last)
Generates html code for the category selection.
|
java.lang.String |
getConfiguration()
Returns the configuration string.
|
java.lang.String |
getConfiguration(CmsObject cms,
A_CmsXmlContentValue schemaType,
CmsMessages messages,
CmsResource resource,
java.util.Locale contentLocale)
Returns the configuration string for the ADE content editor widget.
|
java.util.List<java.lang.String> |
getCssResourceLinks(CmsObject cms)
Returns a list of CSS resources required by the widget.
|
I_CmsXmlContentHandler.DisplayType |
getDefaultDisplayType()
Returns the default display type of this widget.
|
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.
|
java.lang.String |
getInitCall()
Returns the java script initialization call.
|
java.util.List<java.lang.String> |
getJavaScriptResourceLinks(CmsObject cms)
Returns a list of java script resources required by the widget.
|
protected CmsResource |
getResource(CmsObject cms,
I_CmsWidgetParameter param)
Returns the right resource, depending on the locale.
|
java.lang.String |
getStartingCategory(CmsObject cms,
java.lang.String referencePath)
Returns the starting category depending on the configuration options.
|
java.lang.String |
getWidgetName()
Returns the class name of the widget.
|
boolean |
isCompactViewEnabled()
Returns if the widget is compact view enabled.
|
boolean |
isInternal()
Returns if this is an internal widget.
|
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<java.lang.String,java.lang.String[]> 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.
|
equals, getDialogHtmlEnd, getDialogInitCall, getDialogInitMethod, getHelpBubble, getHelpKey, getHelpText, getJsHelpMouseHandler, getJSIncludeFile, getLabelKey, getWidgetStringValue, hashCodeclone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitgetDialogHtmlEnd, getDialogInitCall, getDialogInitMethod, getHelpBubble, getHelpText, getWidgetStringValuepublic static final java.lang.String CONFIGURATION_CATEGORY
public static final java.lang.String CONFIGURATION_ONLYLEAFS
public static final java.lang.String CONFIGURATION_PROPERTY
public CmsCategoryWidget()
public CmsCategoryWidget(java.lang.String configuration)
configuration - the configuration for the widgetpublic java.lang.String getConfiguration()
A_CmsWidgetgetConfiguration in interface I_CmsWidgetgetConfiguration in class A_CmsWidgetA_CmsWidget.getConfiguration()public java.lang.String getConfiguration(CmsObject cms, A_CmsXmlContentValue schemaType, CmsMessages messages, CmsResource resource, java.util.Locale contentLocale)
I_CmsADEWidgetgetConfiguration in interface I_CmsADEWidgetcms - the OpenCms contextschemaType - the schema typemessages - the messagesresource - the edited resourcecontentLocale - the content localeI_CmsADEWidget.getConfiguration(org.opencms.file.CmsObject, org.opencms.xml.types.A_CmsXmlContentValue, org.opencms.i18n.CmsMessages, org.opencms.file.CmsResource, java.util.Locale)public java.util.List<java.lang.String> getCssResourceLinks(CmsObject cms)
I_CmsADEWidgetgetCssResourceLinks in interface I_CmsADEWidgetcms - the current OpenCms contextI_CmsADEWidget.getCssResourceLinks(org.opencms.file.CmsObject)public I_CmsXmlContentHandler.DisplayType getDefaultDisplayType()
I_CmsADEWidgetgetDefaultDisplayType in interface I_CmsADEWidgetI_CmsADEWidget.getDefaultDisplayType()public java.lang.String getDialogIncludes(CmsObject cms, I_CmsWidgetDialog widgetDialog)
I_CmsWidgetgetDialogIncludes in interface I_CmsWidgetgetDialogIncludes in class A_CmsWidgetcms - the current users OpenCms contextwidgetDialog - the dialog where the widget is used onI_CmsWidget.getDialogIncludes(org.opencms.file.CmsObject, org.opencms.widgets.I_CmsWidgetDialog)public java.lang.String getDialogWidget(CmsObject cms, I_CmsWidgetDialog widgetDialog, I_CmsWidgetParameter param)
I_CmsWidgetgetDialogWidget in interface I_CmsWidgetcms - an initialized instance of a CmsObjectwidgetDialog - the dialog where the widget is used onparam - the widget parameter to generate the widget forI_CmsWidget.getDialogWidget(org.opencms.file.CmsObject, org.opencms.widgets.I_CmsWidgetDialog, org.opencms.widgets.I_CmsWidgetParameter)public java.lang.String getInitCall()
I_CmsADEWidgetgetInitCall in interface I_CmsADEWidgetI_CmsADEWidget.getInitCall()public java.util.List<java.lang.String> getJavaScriptResourceLinks(CmsObject cms)
I_CmsADEWidgetgetJavaScriptResourceLinks in interface I_CmsADEWidgetcms - the current OpenCms contextI_CmsADEWidget.getJavaScriptResourceLinks(org.opencms.file.CmsObject)public java.lang.String getStartingCategory(CmsObject cms, java.lang.String referencePath)
cms - the cms contextreferencePath - the right resource pathpublic java.lang.String getWidgetName()
I_CmsADEWidgetgetWidgetName in interface I_CmsADEWidgetI_CmsADEWidget.getWidgetName()public boolean isCompactViewEnabled()
I_CmsWidgetisCompactViewEnabled in interface I_CmsWidgetisCompactViewEnabled in class A_CmsWidgettrue if the widget is compact view enabledA_CmsWidget.isCompactViewEnabled()public boolean isInternal()
I_CmsADEWidgetOnly widgets belonging to the OpenCms core should be marked as internal.
isInternal in interface I_CmsADEWidgettrue if this is an internal widgetI_CmsADEWidget.isInternal()public boolean isOnlyLeafs()
true, if only leaf selection is allowedpublic I_CmsWidget newInstance()
I_CmsWidgetnewInstance in interface I_CmsWidgetI_CmsWidget.newInstance()public void setConfiguration(java.lang.String configuration)
I_CmsWidgetThis 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_CmsWidgetsetConfiguration in class A_CmsWidgetconfiguration - the configuration to setA_CmsWidget.setConfiguration(java.lang.String)public void setEditorValue(CmsObject cms, java.util.Map<java.lang.String,java.lang.String[]> formParameters, I_CmsWidgetDialog widgetDialog, I_CmsWidgetParameter param)
I_CmsWidgetsetEditorValue in interface I_CmsWidgetsetEditorValue in class A_CmsWidgetcms - 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)protected java.lang.String buildSelectBox(java.lang.String baseId, int level, java.util.List<CmsSelectWidgetOption> 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 levelprotected java.util.Locale getDefaultLocale(CmsObject cms, java.lang.String resource)
cms - the cms contextresource - the resource path to get the default locale forprotected CmsResource getResource(CmsObject cms, I_CmsWidgetParameter param)
cms - the cms contextparam - the widget parameter