public abstract class A_CmsNativeComplexWidget extends java.lang.Object implements I_CmsComplexWidget
Subclasses of this class only need to implement the methods getScripts(), getStyleSheets(), getName(), and configure(). The name of the initialization function is generated by prepending the string "init_" to the widget name returned by getName().
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
INIT_FUNCTION_PREFIX
The prefix which is prepended to the widget name to get the name of the initialization function.
|
protected java.lang.String |
m_configuration
The configuration string.
|
protected java.util.Map<java.lang.String,java.lang.String> |
m_configurationMap
The configuration map created from the configuration string.
|
protected JSONObject |
m_jsonConfig
The configuration map in JSON format.
|
Constructor and Description |
---|
A_CmsNativeComplexWidget() |
Modifier and Type | Method and Description |
---|---|
abstract java.lang.String |
getName()
Gets the name of the complex widget.
|
abstract java.util.List<java.lang.String> |
getScripts(CmsObject cms)
Gets the list of URLs of scripts which the widget reuires.
|
abstract java.util.List<java.lang.String> |
getStyleSheets(CmsObject cms)
Gets the list of URLs of stylesheets which are required by the widget.
|
CmsComplexWidgetData |
getWidgetData(CmsObject cms)
Gets the data needed for the editor to render the complex widget.
|
void |
initConfiguration(java.lang.String config)
Initializes the configuration date from the given configuration string.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
configure
public static final java.lang.String INIT_FUNCTION_PREFIX
protected java.lang.String m_configuration
protected java.util.Map<java.lang.String,java.lang.String> m_configurationMap
protected JSONObject m_jsonConfig
public A_CmsNativeComplexWidget()
public abstract java.lang.String getName()
I_CmsComplexWidget
The string returned by this function should be a valid Javascript identifier.
getName
in interface I_CmsComplexWidget
The result of this method will be used to determine the initialization function name for the widget by prepending
the prefix "init_". For example, if "foo" is returned by this method, "init_foo" will be used as the initialization function
name.
public abstract java.util.List<java.lang.String> getScripts(CmsObject cms)
cms
- the current CMS contextpublic abstract java.util.List<java.lang.String> getStyleSheets(CmsObject cms)
cms
- the current CMS contextpublic final CmsComplexWidgetData getWidgetData(CmsObject cms)
I_CmsComplexWidget
getWidgetData
in interface I_CmsComplexWidget
cms
- The CMS object to use for VFS operationsI_CmsComplexWidget.getWidgetData(org.opencms.file.CmsObject)
public final void initConfiguration(java.lang.String config)
This should be called by subclasses of this class.
config
- the widget configuration string