Nuxeo ECM Projects 5.4.3-SNAPSHOT

org.nuxeo.ecm.platform.forms.layout.api
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 Summary
 FieldDefinition[] getFieldDefinitions()
          Returns the list of fields managed by this widget.
 String getHelpLabel()
          Return the help label to use in this mode.
 String getId()
          Returns the widget id, unique within the facelet context.
 String getLabel()
          Returns the label to use in this mode.
 String getLayoutName()
          Returns the layout name.
 int getLevel()
          Returns the widget level in the widget hierarchy.
 String getMode()
          Returns the widget mode.
 String getName()
          Returns the widget name used to identify it within a layout.
 Map<String,Serializable> getProperties()
          Get properties to use in this mode.
 Serializable getProperty(String name)
          Returns property with given name in this mode.
 WidgetSelectOption[] getSelectOptions()
          Returns the select options for this widget.
 Widget[] getSubWidgets()
          Returns sub widgets.
 String getTagConfigId()
          Returns the unique identifier of this widget to be used in tag configuration.
 String getType()
          Returns the widget type used to render it.
 String getValueName()
          Gets the value name used to compute tag attributes.
 boolean isRequired()
          Returns true if the widget is required.
 boolean isTranslated()
          Returns true if all labels are messages that need to be translated.
 void setId(String id)
          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 Detail

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:
Layout#getTagConfigId()}.

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.


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.


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

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

Nuxeo ECM Projects 5.4.3-SNAPSHOT

Copyright © 2011 Nuxeo SAS. All Rights Reserved.