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