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
FieldsModifier and TypeFieldDescriptionprotected Map<String,Map<String, Serializable>> protected booleanprotected FieldDefinition[]protected booleanprotected Stringprotected Map<String,Map<String, Serializable>> protected Map<String,List<RenderingInfo>> protected WidgetSelectOption[]protected WidgetReference[]protected WidgetDefinition[]protected booleanprotected Stringprotected Stringprotected 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
ConstructorsModifierConstructorDescriptionprotectedWidgetDefinitionImpl(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.booleanReturn 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.booleanReturns true if this widget was generated from configuration on a service, and not generated on-the-fly using dynamic behaviors.booleanisGlobal()Returns true if the widget is defined globally (as opposed to being held by a layout definition).booleanReturns true if all labels are messages that need to be translated.voidsetAliases(List<String> aliases) voidsetControls(Map<String, Map<String, Serializable>> controls) Sets controls by mode on widget definition.voidsetDynamic(boolean dynamic) voidsetFieldDefinitions(FieldDefinition[] fieldDefinitions) voidsetGlobal(boolean global) Sets the global status on this definition, depending on how it's been retrievd by the service.voidsetHelpLabels(Map<String, String> helpLabels) voidvoidvoidvoidsetProperties(Map<String, Map<String, Serializable>> properties) voidsetRenderingInfos(Map<String, List<RenderingInfo>> renderingInfos) voidsetSelectOptions(WidgetSelectOption[] selectOptions) voidsetSubWidgetDefinitions(WidgetDefinition[] subWidgets) voidsetSubWidgetReferences(WidgetReference[] subWidgetReferences) voidsetTranslated(boolean translated) voidvoidsetTypeCategory(String typeCategory) Sets the type category to use when retrieving the corresponding widget type.voidsetWidgetModeProperties(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:WidgetDefinitionReturns the list of fields managed by this widget.- Specified by:
getFieldDefinitionsin interfaceWidgetDefinition
-
setFieldDefinitions
- Specified by:
setFieldDefinitionsin interfaceWidgetDefinition
-
getHelpLabel
Description copied from interface:WidgetDefinitionReturns the help label to use in a given mode.- Specified by:
getHelpLabelin interfaceWidgetDefinition
-
getHelpLabels
Description copied from interface:WidgetDefinitionReturns help labels by mode.- Specified by:
getHelpLabelsin interfaceWidgetDefinition
-
setHelpLabels
- Specified by:
setHelpLabelsin interfaceWidgetDefinition
-
getLabel
Description copied from interface:WidgetDefinitionReturns the label to use in a given mode.- Specified by:
getLabelin interfaceWidgetDefinition
-
getLabels
Description copied from interface:WidgetDefinitionReturns labels by mode.- Specified by:
getLabelsin interfaceWidgetDefinition
-
setLabels
- Specified by:
setLabelsin interfaceWidgetDefinition
-
getMode
Description copied from interface:WidgetDefinitionReturns the optional mode used to override the layout mode.Can be a string or an EL ValueExpression.
- Specified by:
getModein interfaceWidgetDefinition- Parameters:
layoutMode- the layout (or parent widget) mode- Returns:
- the overriding widget mode or null if none is defined.
-
getModes
- Specified by:
getModesin interfaceWidgetDefinition
-
setModes
- Specified by:
setModesin interfaceWidgetDefinition
-
getName
Description copied from interface:WidgetDefinitionReturns the widget name used to identify it within a layout.- Specified by:
getNamein interfaceWidgetDefinition
-
setName
- Specified by:
setNamein interfaceWidgetDefinition
-
getProperties
Description copied from interface:WidgetDefinitionReturns 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:
getPropertiesin interfaceWidgetDefinition
-
getProperties
Description copied from interface:WidgetDefinitionReturns properties by mode.- Specified by:
getPropertiesin interfaceWidgetDefinition
-
setProperties
- Specified by:
setPropertiesin interfaceWidgetDefinition
-
getWidgetModeProperties
Description copied from interface:WidgetDefinitionReturns properties by widget mode.- Specified by:
getWidgetModePropertiesin interfaceWidgetDefinition
-
setWidgetModeProperties
- Specified by:
setWidgetModePropertiesin interfaceWidgetDefinition
-
getControls
Description copied from interface:WidgetDefinitionReturns controls for given mode.- Specified by:
getControlsin interfaceWidgetDefinition- See Also:
-
getControls
Description copied from interface:WidgetDefinitionReturns 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:
getControlsin interfaceWidgetDefinition
-
setControls
Description copied from interface:WidgetDefinitionSets controls by mode on widget definition.- Specified by:
setControlsin interfaceWidgetDefinition
-
getRequired
Description copied from interface:WidgetDefinitionReturns 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:
getRequiredin interfaceWidgetDefinition
-
getSubWidgetDefinitions
Description copied from interface:WidgetDefinitionReturns sub widget definitions.- Specified by:
getSubWidgetDefinitionsin interfaceWidgetDefinition
-
setSubWidgetDefinitions
- Specified by:
setSubWidgetDefinitionsin interfaceWidgetDefinition
-
getSubWidgetReferences
Description copied from interface:WidgetDefinitionReturns sub widget definitions references.- Specified by:
getSubWidgetReferencesin interfaceWidgetDefinition
-
setSubWidgetReferences
- Specified by:
setSubWidgetReferencesin interfaceWidgetDefinition
-
getType
Description copied from interface:WidgetDefinitionReturns the widget type used to render it.- Specified by:
getTypein interfaceWidgetDefinition
-
setType
- Specified by:
setTypein interfaceWidgetDefinition
-
getTypeCategory
Description copied from interface:WidgetDefinitionReturns the type category to use when retrieving the corresponding widget type.- Specified by:
getTypeCategoryin interfaceWidgetDefinition
-
setTypeCategory
Description copied from interface:WidgetDefinitionSets the type category to use when retrieving the corresponding widget type.- Specified by:
setTypeCategoryin interfaceWidgetDefinition
-
isTranslated
public boolean isTranslated()Description copied from interface:WidgetDefinitionReturns true if all labels are messages that need to be translated.Defaults to true.
- Specified by:
isTranslatedin interfaceWidgetDefinition
-
setTranslated
public void setTranslated(boolean translated) - Specified by:
setTranslatedin interfaceWidgetDefinition- See Also:
-
getProperties
public static Map<String,Serializable> getProperties(Map<String, Map<String, Serializable>> properties, String mode) -
getSelectOptions
Description copied from interface:WidgetDefinitionReturns the select options for this widget.- Specified by:
getSelectOptionsin interfaceWidgetDefinition
-
setSelectOptions
- Specified by:
setSelectOptionsin interfaceWidgetDefinition
-
getRenderingInfos
Description copied from interface:WidgetDefinitionReturns 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:
getRenderingInfosin interfaceWidgetDefinition
-
setRenderingInfos
- Specified by:
setRenderingInfosin interfaceWidgetDefinition
-
getRenderingInfos
public static List<RenderingInfo> getRenderingInfos(Map<String, List<RenderingInfo>> infos, String mode) -
getRenderingInfos
Description copied from interface:WidgetDefinitionReturns the list of rendering information for given mode.- Specified by:
getRenderingInfosin interfaceWidgetDefinition
-
isDynamic
public boolean isDynamic()Description copied from interface:WidgetDefinitionReturns true if this widget was generated from configuration on a service, and not generated on-the-fly using dynamic behaviors.- Specified by:
isDynamicin interfaceWidgetDefinition
-
setDynamic
public void setDynamic(boolean dynamic) -
isGlobal
public boolean isGlobal()Description copied from interface:WidgetDefinitionReturns true if the widget is defined globally (as opposed to being held by a layout definition).- Specified by:
isGlobalin interfaceWidgetDefinition
-
setGlobal
public void setGlobal(boolean global) Description copied from interface:WidgetDefinitionSets the global status on this definition, depending on how it's been retrievd by the service.- Specified by:
setGlobalin interfaceWidgetDefinition
-
getAliases
Description copied from interface:WidgetDefinitionReturn alias names for this widget definition (useful for compatibility on old widget names).- Specified by:
getAliasesin interfaceWidgetDefinition
-
setAliases
-
clone
Description copied from interface:WidgetDefinitionReturns a clone instance of this widget definition.Useful for conversion of widget definition during export.
- Specified by:
clonein interfaceWidgetDefinition- Overrides:
clonein classObject
-
equals
-
toString
-