Class WidgetDefinitionImpl
- All Implemented Interfaces:
Serializable
,WidgetDefinition
Useful to compute widgets independently from the layout service.
- Since:
- 5.4
- Author:
- Anahide Tchertchian
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionprotected Map<String,
Map<String, Serializable>> protected boolean
protected FieldDefinition[]
protected boolean
protected String
protected Map<String,
Map<String, Serializable>> protected Map<String,
List<RenderingInfo>> protected WidgetSelectOption[]
protected WidgetReference[]
protected WidgetDefinition[]
protected boolean
protected String
protected String
protected Map<String,
Map<String, Serializable>> Fields inherited from interface org.nuxeo.ecm.platform.forms.layout.api.WidgetDefinition
RENDERED_PROPERTY_NAME, REQUIRED_PROPERTY_NAME
-
Constructor Summary
ModifierConstructorDescriptionprotected
WidgetDefinitionImpl
(String name, String type, String label, String helpLabel, boolean translated, Map<String, String> modes, List<FieldDefinition> fieldDefinitions, Map<String, Serializable> properties, List<WidgetDefinition> subWidgets) WidgetDefinitionImpl
(String name, String type, Map<String, String> labels, Map<String, String> helpLabels, boolean translated, Map<String, String> modes, List<FieldDefinition> fieldDefinitions, Map<String, Map<String, Serializable>> properties, Map<String, Map<String, Serializable>> widgetModeProperties, List<WidgetDefinition> subWidgets) WidgetDefinitionImpl
(String name, String type, Map<String, String> labels, Map<String, String> helpLabels, boolean translated, Map<String, String> modes, FieldDefinition[] fieldDefinitions, Map<String, Map<String, Serializable>> properties, Map<String, Map<String, Serializable>> widgetModeProperties, WidgetDefinition[] subWidgets) WidgetDefinitionImpl
(String name, String type, Map<String, String> labels, Map<String, String> helpLabels, boolean translated, Map<String, String> modes, FieldDefinition[] fieldDefinitions, Map<String, Map<String, Serializable>> properties, Map<String, Map<String, Serializable>> widgetModeProperties, WidgetDefinition[] subWidgets, WidgetSelectOption[] selectOptions) -
Method Summary
Modifier and TypeMethodDescriptionclone()
Returns a clone instance of this widget definition.boolean
Return alias names for this widget definition (useful for compatibility on old widget names).Returns controls by mode.getControls
(String layoutMode, String mode) Returns controls for given mode.Returns the list of fields managed by this widget.getHelpLabel
(String mode) Returns the help label to use in a given mode.Returns help labels by mode.Returns the label to use in a given mode.Returns labels by mode.Returns the optional mode used to override the layout mode.getModes()
getName()
Returns the widget name used to identify it within a layout.Returns properties by mode.getProperties
(String layoutMode, String mode) Returns a map of properties to use in a given mode.static Map<String,
Serializable> getProperties
(Map<String, Map<String, Serializable>> properties, String mode) Returns the map of rendering information per mode.getRenderingInfos
(String mode) Returns the list of rendering information for given mode.static List<RenderingInfo>
getRenderingInfos
(Map<String, List<RenderingInfo>> infos, String mode) getRequired
(String layoutMode, String mode) Returns an EL expression evaluating to true if the widget is required in given mode.Returns the select options for this widget.Returns sub widget definitions.Returns sub widget definitions references.getType()
Returns the widget type used to render it.Returns the type category to use when retrieving the corresponding widget type.Returns properties by widget mode.boolean
Returns true if this widget was generated from configuration on a service, and not generated on-the-fly using dynamic behaviors.boolean
isGlobal()
Returns true if the widget is defined globally (as opposed to being held by a layout definition).boolean
Returns true if all labels are messages that need to be translated.void
setAliases
(List<String> aliases) void
setControls
(Map<String, Map<String, Serializable>> controls) Sets controls by mode on widget definition.void
setDynamic
(boolean dynamic) void
setFieldDefinitions
(FieldDefinition[] fieldDefinitions) void
setGlobal
(boolean global) Sets the global status on this definition, depending on how it's been retrievd by the service.void
setHelpLabels
(Map<String, String> helpLabels) void
void
void
void
setProperties
(Map<String, Map<String, Serializable>> properties) void
setRenderingInfos
(Map<String, List<RenderingInfo>> renderingInfos) void
setSelectOptions
(WidgetSelectOption[] selectOptions) void
setSubWidgetDefinitions
(WidgetDefinition[] subWidgets) void
setSubWidgetReferences
(WidgetReference[] subWidgetReferences) void
setTranslated
(boolean translated) void
void
setTypeCategory
(String typeCategory) Sets the type category to use when retrieving the corresponding widget type.void
setWidgetModeProperties
(Map<String, Map<String, Serializable>> widgetModeProperties) toString()
-
Field Details
-
name
-
type
-
typeCategory
-
labels
-
helpLabels
-
translated
protected boolean translated -
modes
-
fieldDefinitions
-
properties
-
widgetModeProperties
-
controls
-
subWidgets
-
subWidgetReferences
-
selectOptions
-
renderingInfos
-
aliases
-
dynamic
protected boolean dynamic -
global
protected boolean global
-
-
Constructor Details
-
WidgetDefinitionImpl
protected WidgetDefinitionImpl() -
WidgetDefinitionImpl
public WidgetDefinitionImpl(String name, String type, String label, String helpLabel, boolean translated, Map<String, String> modes, List<FieldDefinition> fieldDefinitions, Map<String, Serializable> properties, List<WidgetDefinition> subWidgets) -
WidgetDefinitionImpl
public WidgetDefinitionImpl(String name, String type, Map<String, String> labels, Map<String, String> helpLabels, boolean translated, Map<String, String> modes, List<FieldDefinition> fieldDefinitions, Map<String, Map<String, Serializable>> properties, Map<String, Map<String, Serializable>> widgetModeProperties, List<WidgetDefinition> subWidgets) -
WidgetDefinitionImpl
public WidgetDefinitionImpl(String name, String type, Map<String, String> labels, Map<String, String> helpLabels, boolean translated, Map<String, String> modes, FieldDefinition[] fieldDefinitions, Map<String, Map<String, Serializable>> properties, Map<String, Map<String, Serializable>> widgetModeProperties, WidgetDefinition[] subWidgets) -
WidgetDefinitionImpl
public WidgetDefinitionImpl(String name, String type, Map<String, String> labels, Map<String, String> helpLabels, boolean translated, Map<String, String> modes, FieldDefinition[] fieldDefinitions, Map<String, Map<String, Serializable>> properties, Map<String, Map<String, Serializable>> widgetModeProperties, WidgetDefinition[] subWidgets, WidgetSelectOption[] selectOptions) - Since:
- 5.4.2
-
-
Method Details
-
getFieldDefinitions
Description copied from interface:WidgetDefinition
Returns the list of fields managed by this widget.- Specified by:
getFieldDefinitions
in interfaceWidgetDefinition
-
setFieldDefinitions
- Specified by:
setFieldDefinitions
in interfaceWidgetDefinition
-
getHelpLabel
Description copied from interface:WidgetDefinition
Returns the help label to use in a given mode.- Specified by:
getHelpLabel
in interfaceWidgetDefinition
-
getHelpLabels
Description copied from interface:WidgetDefinition
Returns help labels by mode.- Specified by:
getHelpLabels
in interfaceWidgetDefinition
-
setHelpLabels
- Specified by:
setHelpLabels
in interfaceWidgetDefinition
-
getLabel
Description copied from interface:WidgetDefinition
Returns the label to use in a given mode.- Specified by:
getLabel
in interfaceWidgetDefinition
-
getLabels
Description copied from interface:WidgetDefinition
Returns labels by mode.- Specified by:
getLabels
in interfaceWidgetDefinition
-
setLabels
- Specified by:
setLabels
in interfaceWidgetDefinition
-
getMode
Description copied from interface:WidgetDefinition
Returns the optional mode used to override the layout mode.Can be a string or an EL ValueExpression.
- Specified by:
getMode
in interfaceWidgetDefinition
- Parameters:
layoutMode
- the layout (or parent widget) mode- Returns:
- the overriding widget mode or null if none is defined.
-
getModes
- Specified by:
getModes
in interfaceWidgetDefinition
-
setModes
- Specified by:
setModes
in interfaceWidgetDefinition
-
getName
Description copied from interface:WidgetDefinition
Returns the widget name used to identify it within a layout.- Specified by:
getName
in interfaceWidgetDefinition
-
setName
- Specified by:
setName
in interfaceWidgetDefinition
-
getProperties
Description copied from interface:WidgetDefinition
Returns a map of properties to use in a given mode.A property value can be a string or an EL ValueExpression.
The way that properties will be mapped to rendered components is managed by the widget type.
- Specified by:
getProperties
in interfaceWidgetDefinition
-
getProperties
Description copied from interface:WidgetDefinition
Returns properties by mode.- Specified by:
getProperties
in interfaceWidgetDefinition
-
setProperties
- Specified by:
setProperties
in interfaceWidgetDefinition
-
getWidgetModeProperties
Description copied from interface:WidgetDefinition
Returns properties by widget mode.- Specified by:
getWidgetModeProperties
in interfaceWidgetDefinition
-
setWidgetModeProperties
- Specified by:
setWidgetModeProperties
in interfaceWidgetDefinition
-
getControls
Description copied from interface:WidgetDefinition
Returns controls for given mode.- Specified by:
getControls
in interfaceWidgetDefinition
- See Also:
-
getControls
Description copied from interface:WidgetDefinition
Returns controls by mode.Controls are property-like markers on widget instances, expect these are not forwarded to the underlying rendering object (like the JSF component attributes).
This makes it possible to keep "flags" on widgets that can be checked by parent widget or layout, for instance "addForm" or "handlingLabels" markers.
- Specified by:
getControls
in interfaceWidgetDefinition
-
setControls
Description copied from interface:WidgetDefinition
Sets controls by mode on widget definition.- Specified by:
setControls
in interfaceWidgetDefinition
-
getRequired
Description copied from interface:WidgetDefinition
Returns an EL expression evaluating to true if the widget is required in given mode.This value is computed from the property "required" in given mode. and can be a string or an EL ValueExpression. Defaults to "false".
- Specified by:
getRequired
in interfaceWidgetDefinition
-
getSubWidgetDefinitions
Description copied from interface:WidgetDefinition
Returns sub widget definitions.- Specified by:
getSubWidgetDefinitions
in interfaceWidgetDefinition
-
setSubWidgetDefinitions
- Specified by:
setSubWidgetDefinitions
in interfaceWidgetDefinition
-
getSubWidgetReferences
Description copied from interface:WidgetDefinition
Returns sub widget definitions references.- Specified by:
getSubWidgetReferences
in interfaceWidgetDefinition
-
setSubWidgetReferences
- Specified by:
setSubWidgetReferences
in interfaceWidgetDefinition
-
getType
Description copied from interface:WidgetDefinition
Returns the widget type used to render it.- Specified by:
getType
in interfaceWidgetDefinition
-
setType
- Specified by:
setType
in interfaceWidgetDefinition
-
getTypeCategory
Description copied from interface:WidgetDefinition
Returns the type category to use when retrieving the corresponding widget type.- Specified by:
getTypeCategory
in interfaceWidgetDefinition
-
setTypeCategory
Description copied from interface:WidgetDefinition
Sets the type category to use when retrieving the corresponding widget type.- Specified by:
setTypeCategory
in interfaceWidgetDefinition
-
isTranslated
public boolean isTranslated()Description copied from interface:WidgetDefinition
Returns true if all labels are messages that need to be translated.Defaults to true.
- Specified by:
isTranslated
in interfaceWidgetDefinition
-
setTranslated
public void setTranslated(boolean translated) - Specified by:
setTranslated
in interfaceWidgetDefinition
- See Also:
-
getProperties
public static Map<String,Serializable> getProperties(Map<String, Map<String, Serializable>> properties, String mode) -
getSelectOptions
Description copied from interface:WidgetDefinition
Returns the select options for this widget.- Specified by:
getSelectOptions
in interfaceWidgetDefinition
-
setSelectOptions
- Specified by:
setSelectOptions
in interfaceWidgetDefinition
-
getRenderingInfos
Description copied from interface:WidgetDefinition
Returns the map of rendering information per mode.Useful for preview management where some configuration needs to be changed: what's changed can be set as rendering information here to be displayed.
- Specified by:
getRenderingInfos
in interfaceWidgetDefinition
-
setRenderingInfos
- Specified by:
setRenderingInfos
in interfaceWidgetDefinition
-
getRenderingInfos
public static List<RenderingInfo> getRenderingInfos(Map<String, List<RenderingInfo>> infos, String mode) -
getRenderingInfos
Description copied from interface:WidgetDefinition
Returns the list of rendering information for given mode.- Specified by:
getRenderingInfos
in interfaceWidgetDefinition
-
isDynamic
public boolean isDynamic()Description copied from interface:WidgetDefinition
Returns true if this widget was generated from configuration on a service, and not generated on-the-fly using dynamic behaviors.- Specified by:
isDynamic
in interfaceWidgetDefinition
-
setDynamic
public void setDynamic(boolean dynamic) -
isGlobal
public boolean isGlobal()Description copied from interface:WidgetDefinition
Returns true if the widget is defined globally (as opposed to being held by a layout definition).- Specified by:
isGlobal
in interfaceWidgetDefinition
-
setGlobal
public void setGlobal(boolean global) Description copied from interface:WidgetDefinition
Sets the global status on this definition, depending on how it's been retrievd by the service.- Specified by:
setGlobal
in interfaceWidgetDefinition
-
getAliases
Description copied from interface:WidgetDefinition
Return alias names for this widget definition (useful for compatibility on old widget names).- Specified by:
getAliases
in interfaceWidgetDefinition
-
setAliases
-
clone
Description copied from interface:WidgetDefinition
Returns a clone instance of this widget definition.Useful for conversion of widget definition during export.
- Specified by:
clone
in interfaceWidgetDefinition
- Overrides:
clone
in classObject
-
equals
-
toString
-