Nuxeo Enterprise Platform 5.4

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

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
WidgetDefinitionImpl, WidgetDescriptor

public interface WidgetDefinition
extends java.io.Serializable

Widget interface.

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

Author:
Anahide Tchertchian

Field Summary
static java.lang.String RENDERED_PROPERTY_NAME
           
static java.lang.String REQUIRED_PROPERTY_NAME
           
 
Method Summary
 FieldDefinition[] getFieldDefinitions()
          Returns the list of fields managed by this widget.
 java.lang.String getHelpLabel(java.lang.String mode)
          Returns the help label to use in a given mode.
 java.util.Map<java.lang.String,java.lang.String> getHelpLabels()
          Returns help labels by mode.
 java.lang.String getLabel(java.lang.String mode)
          Returns the label to use in a given mode.
 java.util.Map<java.lang.String,java.lang.String> getLabels()
          Returns labels by mode.
 java.lang.String getMode(java.lang.String layoutMode)
          Returns the optional mode used to override the layout mode.
 java.util.Map<java.lang.String,java.lang.String> getModes()
           
 java.lang.String getName()
          Returns the widget name used to identify it within a layout.
 java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.io.Serializable>> getProperties()
          Returns properties by mode.
 java.util.Map<java.lang.String,java.io.Serializable> getProperties(java.lang.String layoutMode, java.lang.String mode)
          Returns a map of properties to use in a given mode.
 java.lang.String getRequired(java.lang.String layoutMode, java.lang.String mode)
          Returns an EL expression evaluating to true if the widget is required in given mode.
 WidgetDefinition[] getSubWidgetDefinitions()
          Returns sub widget definitions.
 java.lang.String getType()
          Returns the widget type used to render it.
 java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.io.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 java.lang.String RENDERED_PROPERTY_NAME
See Also:
Constant Field Values

REQUIRED_PROPERTY_NAME

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

getName

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


getType

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


getFieldDefinitions

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


getMode

java.lang.String getMode(java.lang.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

java.util.Map<java.lang.String,java.lang.String> getModes()

getRequired

java.lang.String getRequired(java.lang.String layoutMode,
                             java.lang.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

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


getLabels

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


getHelpLabel

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


getHelpLabels

java.util.Map<java.lang.String,java.lang.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

java.util.Map<java.lang.String,java.io.Serializable> getProperties(java.lang.String layoutMode,
                                                                   java.lang.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

java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.io.Serializable>> getProperties()
Returns properties by mode.


getWidgetModeProperties

java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.io.Serializable>> getWidgetModeProperties()
Returns properties by widget mode.


getSubWidgetDefinitions

WidgetDefinition[] getSubWidgetDefinitions()
Returns sub widget definitions.


Nuxeo Enterprise Platform 5.4

Copyright © 2010 Nuxeo SAS. All Rights Reserved.