Class CmsWidgetFactoryRegistry
java.lang.Object
org.opencms.gwt.client.ui.input.form.CmsWidgetFactoryRegistry
- All Implemented Interfaces:
I_CmsFormWidgetMultiFactory
This singleton class is used for registering all widget factories.
- Since:
- 8.0.0
-
Method Summary
Modifier and TypeMethodDescriptioncreateFormWidget(String key, Map<String, String> widgetParams, com.google.common.base.Optional<String> defaultValue) Creates a new widget based on a type string and widget parameters.static CmsWidgetFactoryRegistryinstance()Returns the singleton instance of this class.voidregisterFactory(String key, I_CmsFormWidgetFactory factory) Registers a new widget factory for a given widget type key.
-
Method Details
-
instance
Returns the singleton instance of this class.- Returns:
- the singleton instance of this class
-
createFormWidget
public I_CmsFormWidget createFormWidget(String key, Map<String, String> widgetParams, com.google.common.base.Optional<String> defaultValue) Creates a new widget based on a type string and widget parameters.- Specified by:
createFormWidgetin interfaceI_CmsFormWidgetMultiFactory- Parameters:
key- the type stringwidgetParams- the widget configuration parametersdefaultValue- an optional default value- Returns:
- the newly created widget
-
registerFactory
Registers a new widget factory for a given widget type key.- Parameters:
key- the widget type keyfactory- the new factory for the key
-