Interface Widget
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
WidgetImpl
Widget interface.
A widget is built from a WidgetDefinition
in a given mode.
- Author:
- Anahide Tchertchian
-
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
Sets the widget id, unique within the facelet context.void
setProperty
(String name, Serializable value) Sets property with given name on the layout.void
setValueName
(String valueName) Sets the value name used to compute tag attributes.
-
Method Details
-
getId
String getId()Returns the widget id, unique within the facelet context. -
getTagConfigId
String getTagConfigId()Returns the unique identifier of this widget to be used in tag configuration.- Since:
- 5.4.2
- See Also:
-
setId
Sets the widget id, unique within the facelet context. -
getName
String getName()Returns the widget name used to identify it within a layout. -
getLayoutName
String getLayoutName()Returns the layout name. -
getType
String getType()Returns the widget type used to render it. -
getTypeCategory
String getTypeCategory()Returns the widget type category.- Since:
- 5.7.3
-
getValueName
String getValueName()Gets the value name used to compute tag attributes. -
setValueName
Sets the value name used to compute tag attributes. -
getFieldDefinitions
FieldDefinition[] getFieldDefinitions()Returns the list of fields managed by this widget. -
getMode
String getMode()Returns the widget mode.This mode can be different from the layout mode.
-
getLabel
String getLabel()Returns the label to use in this mode. -
getHelpLabel
String getHelpLabel()Return the help label to use in this mode. -
isTranslated
boolean isTranslated()Returns true if all labels are messages that need to be translated.Defaults to false.
-
isHandlingLabels
boolean isHandlingLabels()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.
- Since:
- 5.6
-
getProperties
Map<String,Serializable> getProperties()Get properties to use in this mode.The way that properties will be mapped to rendered components is managed by the widget type.
-
getProperty
Returns property with given name in this mode.- Parameters:
name
- the property name.- Returns:
- the property value or null if not found.
-
setProperty
Sets property with given name on the layout. If there is already a property with this name on the widget, it will be overridden.- Parameters:
name
- the property name.value
- the property value or null if not found.- Since:
- 5.3.2
-
getControls
Map<String,Serializable> getControls()Returns controls on this widget.- Since:
- 5.7
- See Also:
-
getControl
Returns control with given name.- Since:
- 5.7
- See Also:
-
setControl
Sets control with given name and value.- Since:
- 5.7
- See Also:
-
isRequired
boolean isRequired()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.
-
getSubWidgets
Widget[] getSubWidgets()Returns sub widgets. -
getLevel
int getLevel()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
WidgetSelectOption[] getSelectOptions()Returns the select options for this widget.- Since:
- 5.4.2
-
getRenderingInfos
List<RenderingInfo> getRenderingInfos()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.
- Since:
- 5.5
-
isGlobal
boolean isGlobal()Returns true if the widget is defined globally (as opposed to being held by a layout definition).- Since:
- 6.0
-
isDynamic
boolean isDynamic()Returns true if this widget was generated from configuration on a service, and not generated on-the-fly using dynamic behaviors.- Since:
- 6.0
-
getDefinition
WidgetDefinition getDefinition()Returns the definition from which this widget instance was generated.Useful in dev mode to show the corresponding configuration in the UI.
- Since:
- 6.0
-