Nuxeo ECM Projects 5.4.3-SNAPSHOT

org.nuxeo.ecm.platform.forms.layout.api
Interface WidgetDefinition

All Superinterfaces:
Serializable
All Known Implementing Classes:
WidgetDefinitionImpl, WidgetDescriptor

public interface WidgetDefinition
extends Serializable

Widget definition interface.

A widget knows how to render itself in a given mode.

Author:
Anahide Tchertchian

Field Summary
static String RENDERED_PROPERTY_NAME
           
static String REQUIRED_PROPERTY_NAME
           
 
Method Summary
 FieldDefinition[] getFieldDefinitions()
          Returns the list of fields managed by this widget.
 String getHelpLabel(String mode)
          Returns the help label to use in a given mode.
 Map<String,String> getHelpLabels()
          Returns help labels by mode.
 String getLabel(String mode)
          Returns the label to use in a given mode.
 Map<String,String> getLabels()
          Returns labels by mode.
 String getMode(String layoutMode)
          Returns the optional mode used to override the layout mode.
 Map<String,String> getModes()
           
 String getName()
          Returns the widget name used to identify it within a layout.
 Map<String,Map<String,Serializable>> getProperties()
          Returns properties by mode.
 Map<String,Serializable> getProperties(String layoutMode, String mode)
          Returns a map of properties to use in a given mode.
 String getRequired(String layoutMode, String mode)
          Returns an EL expression evaluating to true if the widget is required in given mode.
 WidgetSelectOption[] getSelectOptions()
          Returns the select options for this widget.
 WidgetDefinition[] getSubWidgetDefinitions()
          Returns sub widget definitions.
 String getType()
          Returns the widget type used to render it.
 Map<String,Map<String,Serializable>> getWidgetModeProperties()
          Returns properties by widget mode.
 boolean isTranslated()
          Returns true if all labels are messages that need to be translated.
 

Field Detail

RENDERED_PROPERTY_NAME

static final String RENDERED_PROPERTY_NAME
See Also:
Constant Field Values

REQUIRED_PROPERTY_NAME

static final String REQUIRED_PROPERTY_NAME
See Also:
Constant Field Values
Method Detail

getName

String getName()
Returns the widget name used to identify it within a layout.


getType

String getType()
Returns the widget type used to render it.


getFieldDefinitions

FieldDefinition[] getFieldDefinitions()
Returns the list of fields managed by this widget.


getMode

String getMode(String layoutMode)
Returns the optional mode used to override the layout mode.

Can be a string or an EL ValueExpression.

Parameters:
layoutMode - the layout (or parent widget) mode
Returns:
the overriding widget mode or null if none is defined.

getModes

Map<String,String> getModes()

getRequired

String getRequired(String layoutMode,
                   String mode)
Returns 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".


getLabel

String getLabel(String mode)
Returns the label to use in a given mode.


getLabels

Map<String,String> getLabels()
Returns labels by mode.


getHelpLabel

String getHelpLabel(String mode)
Returns the help label to use in a given mode.


getHelpLabels

Map<String,String> getHelpLabels()
Returns help labels by mode.


isTranslated

boolean isTranslated()
Returns true if all labels are messages that need to be translated.

Default is true.


getProperties

Map<String,Serializable> getProperties(String layoutMode,
                                       String mode)
Returns 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.


getProperties

Map<String,Map<String,Serializable>> getProperties()
Returns properties by mode.


getWidgetModeProperties

Map<String,Map<String,Serializable>> getWidgetModeProperties()
Returns properties by widget mode.


getSubWidgetDefinitions

WidgetDefinition[] getSubWidgetDefinitions()
Returns sub widget definitions.


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.