Interface Widget

All Superinterfaces:
Serializable
All Known Implementing Classes:
WidgetImpl

public interface Widget extends Serializable
Widget interface.

A widget is built from a WidgetDefinition in a given mode.

Author:
Anahide Tchertchian
  • 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

      void setId(String id)
      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

      void setValueName(String valueName)
      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

      Serializable getProperty(String name)
      Returns property with given name in this mode.
      Parameters:
      name - the property name.
      Returns:
      the property value or null if not found.
    • setProperty

      void setProperty(String name, Serializable value)
      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

      Serializable getControl(String name)
      Returns control with given name.
      Since:
      5.7
      See Also:
    • setControl

      void setControl(String name, Serializable value)
      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