Class WidgetRegistry


  • public final class WidgetRegistry
    extends java.lang.Object
    The widget registry.

    • 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
      • getWidgetFactories

        public java.util.Map<java.lang.String,​I_CmsWidgetFactorygetWidgetFactories()
        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 configurations
        callback - the callback to execute when done
      • registerWidgetFactory

        public void registerWidgetFactory​(java.lang.String widgetName,
                                          I_CmsWidgetFactory widgetFactory)
        Registers a widget.

        Parameters:
        widgetName - the widget name
        widgetFactory - 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