Class WidgetRegistry
- java.lang.Object
-
- org.opencms.ade.contenteditor.widgetregistry.client.WidgetRegistry
-
public final class WidgetRegistry extends java.lang.Object
The widget registry.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
REGISTER_WIDGET_FACTORY_FUNCTION
The register widget function name.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addRenderer(I_CmsEntityRenderer renderer)
Adds a renderer which should be used by the Acacia editor.static WidgetRegistry
getInstance()
Returns the widget registry instance.java.util.Collection<I_CmsEntityRenderer>
getRenderers()
Returns the registered renderers.java.util.Map<java.lang.String,I_CmsWidgetFactory>
getWidgetFactories()
Returns the registered widget factories.void
registerExternalWidgets(java.util.List<org.opencms.ade.contenteditor.shared.CmsExternalWidgetConfiguration> externalWidgetConfigurations, com.google.gwt.user.client.Command callback)
Registers external widgets.void
registerWidgetFactory(java.lang.String widgetName, I_CmsWidgetFactory widgetFactory)
Registers a widget.protected void
showError(java.lang.String error)
Logs an error.protected void
showInitCallError(java.util.Set<java.lang.String> initCalls)
Logs an error for missing init calls.protected boolean
tryInitCall(java.lang.String initCall)
Tries to initializes a widget with the given initialization call.
-
-
-
Field Detail
-
REGISTER_WIDGET_FACTORY_FUNCTION
public static final java.lang.String REGISTER_WIDGET_FACTORY_FUNCTION
The register widget function name.- See Also:
- Constant Field Values
-
-
Method Detail
-
getInstance
public static WidgetRegistry getInstance()
Returns the widget registry instance.- Returns:
- the widget registry instance
-
addRenderer
public void addRenderer(I_CmsEntityRenderer renderer)
Adds a renderer which should be used by the Acacia editor.- Parameters:
renderer
- the renderer to add
-
getRenderers
public java.util.Collection<I_CmsEntityRenderer> getRenderers()
Returns the registered renderers.- Returns:
- the renderers
-
getWidgetFactories
public java.util.Map<java.lang.String,I_CmsWidgetFactory> getWidgetFactories()
Returns the registered widget factories.- Returns:
- the registered widget factories
-
registerExternalWidgets
public void registerExternalWidgets(java.util.List<org.opencms.ade.contenteditor.shared.CmsExternalWidgetConfiguration> externalWidgetConfigurations, com.google.gwt.user.client.Command callback)
Registers external widgets.- Parameters:
externalWidgetConfigurations
- the external widget configurationscallback
- the callback to execute when done
-
registerWidgetFactory
public void registerWidgetFactory(java.lang.String widgetName, I_CmsWidgetFactory widgetFactory)
Registers a widget.- Parameters:
widgetName
- the widget namewidgetFactory
- the widget
-
showError
protected void showError(java.lang.String error)
Logs an error.- Parameters:
error
- the error to log
-
showInitCallError
protected void showInitCallError(java.util.Set<java.lang.String> initCalls)
Logs an error for missing init calls.- Parameters:
initCalls
- the set of missing init calls
-
tryInitCall
protected boolean tryInitCall(java.lang.String initCall)
Tries to initializes a widget with the given initialization call. Returns false if the init method was not available within the window context yet.- Parameters:
initCall
- the initialization function name- Returns:
true
if the initialization function was available and has been executed
-
-