Class WidgetImpl
java.lang.Object
org.nuxeo.ecm.platform.forms.layout.api.impl.WidgetImpl
- All Implemented Interfaces:
Serializable
,Widget
Implementation for widgets.
- Author:
- Anahide Tchertchian
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionprotected Map<String,
Serializable> protected WidgetDefinition
protected String
protected boolean
protected FieldDefinition[]
protected boolean
protected String
protected String
protected String
protected String
protected int
protected String
protected String
protected Map<String,
Serializable> protected List<RenderingInfo>
protected boolean
protected WidgetSelectOption[]
protected Widget[]
protected boolean
protected String
protected String
protected String
-
Constructor Summary
ModifierConstructorDescriptionprotected
WidgetImpl
(String layoutName, String name, String mode, String type, String valueName, FieldDefinition[] fields, String label, String helpLabel, boolean translated, Map<String, Serializable> properties, boolean required, Widget[] subWidgets, int level, WidgetSelectOption[] selectOptions, String definitionId) WidgetImpl
(String layoutName, String name, String mode, String type, String valueName, FieldDefinition[] fields, String label, String helpLabel, boolean translated, Map<String, Serializable> properties, boolean required, Widget[] subWidgets, int level, WidgetSelectOption[] selectOptions, String definitionId, List<RenderingInfo> renderingInfos) -
Method Summary
Modifier and TypeMethodDescriptiongetControl
(String name) Returns control with given name.Returns controls on this widget.Returns the definition from which this widget instance was generated.Returns the list of fields managed by this widget.Return the help label to use in this mode.getId()
Returns the widget id, unique within the facelet context.getLabel()
Returns the label to use in this mode.Returns the layout name.int
getLevel()
Returns the widget level in the widget hierarchy.getMode()
Returns the widget mode.getName()
Returns the widget name used to identify it within a layout.Get properties to use in this mode.getProperty
(String name) Returns property with given name in this mode.Returns the list of rendering information.Returns the select options for this widget.Widget[]
Returns sub widgets.Returns the unique identifier of this widget to be used in tag configuration.getType()
Returns the widget type used to render it.Returns the widget type category.Gets the value name used to compute tag attributes.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 the widget is handling his own labels display (usual label and help label).boolean
Returns true if the widget is required.boolean
Returns true if all labels are messages that need to be translated.void
setControl
(String name, Serializable value) Sets control with given name and value.void
setControls
(Map<String, Serializable> controls) void
setDefinition
(WidgetDefinition definition) void
setDynamic
(boolean dynamic) void
setGlobal
(boolean global) void
Sets the widget id, unique within the facelet context.void
setProperty
(String name, Serializable value) Sets property with given name on the layout.void
setTypeCategory
(String typeCategory) void
setValueName
(String valueName) Sets the value name used to compute tag attributes.toString()
-
Field Details
-
id
-
layoutName
-
name
-
mode
-
type
-
typeCategory
-
fields
-
helpLabel
-
subWidgets
-
properties
-
controls
-
required
protected boolean required -
valueName
-
label
-
translated
protected boolean translated -
level
protected int level -
selectOptions
-
renderingInfos
-
definitionId
-
dynamic
protected boolean dynamic -
global
protected boolean global -
definition
-
-
Constructor Details
-
WidgetImpl
protected WidgetImpl() -
WidgetImpl
public WidgetImpl(String layoutName, String name, String mode, String type, String valueName, FieldDefinition[] fields, String label, String helpLabel, boolean translated, Map<String, Serializable> properties, boolean required, Widget[] subWidgets, int level, WidgetSelectOption[] selectOptions, String definitionId) -
WidgetImpl
public WidgetImpl(String layoutName, String name, String mode, String type, String valueName, FieldDefinition[] fields, String label, String helpLabel, boolean translated, Map<String, Serializable> properties, boolean required, Widget[] subWidgets, int level, WidgetSelectOption[] selectOptions, String definitionId, List<RenderingInfo> renderingInfos) - Since:
- 5.5
-
-
Method Details
-
getId
Description copied from interface:Widget
Returns the widget id, unique within the facelet context. -
getTagConfigId
Description copied from interface:Widget
Returns the unique identifier of this widget to be used in tag configuration.- Specified by:
getTagConfigId
in interfaceWidget
- See Also:
-
setId
Description copied from interface:Widget
Sets the widget id, unique within the facelet context. -
getLayoutName
Description copied from interface:Widget
Returns the layout name.- Specified by:
getLayoutName
in interfaceWidget
-
getName
Description copied from interface:Widget
Returns the widget name used to identify it within a layout. -
getMode
Description copied from interface:Widget
Returns the widget mode.This mode can be different from the layout mode.
-
getType
Description copied from interface:Widget
Returns the widget type used to render it. -
getTypeCategory
Description copied from interface:Widget
Returns the widget type category.- Specified by:
getTypeCategory
in interfaceWidget
-
setTypeCategory
-
getLabel
Description copied from interface:Widget
Returns the label to use in this mode. -
getHelpLabel
Description copied from interface:Widget
Return the help label to use in this mode.- Specified by:
getHelpLabel
in interfaceWidget
-
isTranslated
public boolean isTranslated()Description copied from interface:Widget
Returns true if all labels are messages that need to be translated.Defaults to false.
- Specified by:
isTranslated
in interfaceWidget
-
isHandlingLabels
public boolean isHandlingLabels()Description copied from interface:Widget
Returns true if the widget is handling his own labels display (usual label and help label). This can be checked by the layout template to render the widget using both label and widget usual places.Defaults to false.
- Specified by:
isHandlingLabels
in interfaceWidget
-
getProperties
Description copied from interface:Widget
Get properties to use in this mode.The way that properties will be mapped to rendered components is managed by the widget type.
- Specified by:
getProperties
in interfaceWidget
-
getProperty
Description copied from interface:Widget
Returns property with given name in this mode.- Specified by:
getProperty
in interfaceWidget
- Parameters:
name
- the property name.- Returns:
- the property value or null if not found.
-
setProperty
Description copied from interface:Widget
Sets property with given name on the layout. If there is already a property with this name on the widget, it will be overridden.- Specified by:
setProperty
in interfaceWidget
- Parameters:
name
- the property name.value
- the property value or null if not found.
-
getControls
Description copied from interface:Widget
Returns controls on this widget.- Specified by:
getControls
in interfaceWidget
- See Also:
-
getControl
Description copied from interface:Widget
Returns control with given name.- Specified by:
getControl
in interfaceWidget
- See Also:
-
setControl
Description copied from interface:Widget
Sets control with given name and value.- Specified by:
setControl
in interfaceWidget
- See Also:
-
setControls
- Since:
- 6.0
-
isRequired
public boolean isRequired()Description copied from interface:Widget
Returns true if the widget is required.This is a short link for the "required" property, already evaluated from an EL expression (if needed). Defaults to false.
- Specified by:
isRequired
in interfaceWidget
-
getFieldDefinitions
Description copied from interface:Widget
Returns the list of fields managed by this widget.- Specified by:
getFieldDefinitions
in interfaceWidget
-
getSubWidgets
Description copied from interface:Widget
Returns sub widgets.- Specified by:
getSubWidgets
in interfaceWidget
-
getValueName
Description copied from interface:Widget
Gets the value name used to compute tag attributes.- Specified by:
getValueName
in interfaceWidget
-
setValueName
Description copied from interface:Widget
Sets the value name used to compute tag attributes.- Specified by:
setValueName
in interfaceWidget
-
getLevel
public int getLevel()Description copied from interface:Widget
Returns the widget level in the widget hierarchy.For instance a standard widget will have a level of 0, and its potential subwidgets will have a level of 1.
-
getSelectOptions
Description copied from interface:Widget
Returns the select options for this widget.- Specified by:
getSelectOptions
in interfaceWidget
-
getRenderingInfos
Description copied from interface:Widget
Returns the list of rendering information.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 interfaceWidget
-
isDynamic
public boolean isDynamic()Description copied from interface:Widget
Returns true if this widget was generated from configuration on a service, and not generated on-the-fly using dynamic behaviors. -
setDynamic
public void setDynamic(boolean dynamic) -
isGlobal
public boolean isGlobal()Description copied from interface:Widget
Returns true if the widget is defined globally (as opposed to being held by a layout definition). -
setGlobal
public void setGlobal(boolean global) -
getDefinition
Description copied from interface:Widget
Returns the definition from which this widget instance was generated.Useful in dev mode to show the corresponding configuration in the UI.
- Specified by:
getDefinition
in interfaceWidget
-
setDefinition
-
toString
-