Nuxeo Enterprise Platform 5.4

org.nuxeo.ecm.platform.forms.layout.descriptors
Class WidgetDescriptor

java.lang.Object
  extended by org.nuxeo.ecm.platform.forms.layout.descriptors.WidgetDescriptor
All Implemented Interfaces:
java.io.Serializable, WidgetDefinition

public class WidgetDescriptor
extends java.lang.Object
implements WidgetDefinition

Widget definition descriptor.

Author:
Anahide Tchertchian
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface org.nuxeo.ecm.platform.forms.layout.api.WidgetDefinition
RENDERED_PROPERTY_NAME, REQUIRED_PROPERTY_NAME
 
Constructor Summary
WidgetDescriptor()
           
 
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.
static java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.io.Serializable>> getProperties(java.util.Map<java.lang.String,PropertiesDescriptor> map)
           
static java.util.Map<java.lang.String,java.io.Serializable> getProperties(java.util.Map<java.lang.String,PropertiesDescriptor> map, java.lang.String 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.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WidgetDescriptor

public WidgetDescriptor()
Method Detail

getName

public java.lang.String getName()
Description copied from interface: WidgetDefinition
Returns the widget name used to identify it within a layout.

Specified by:
getName in interface WidgetDefinition

getType

public java.lang.String getType()
Description copied from interface: WidgetDefinition
Returns the widget type used to render it.

Specified by:
getType in interface WidgetDefinition

getFieldDefinitions

public FieldDefinition[] getFieldDefinitions()
Description copied from interface: WidgetDefinition
Returns the list of fields managed by this widget.

Specified by:
getFieldDefinitions in interface WidgetDefinition

getMode

public java.lang.String getMode(java.lang.String layoutMode)
Description copied from interface: WidgetDefinition
Returns the optional mode used to override the layout mode.

Can be a string or an EL ValueExpression.

Specified by:
getMode in interface WidgetDefinition
Parameters:
layoutMode - the layout (or parent widget) mode
Returns:
the overriding widget mode or null if none is defined.

getModes

public java.util.Map<java.lang.String,java.lang.String> getModes()
Specified by:
getModes in interface WidgetDefinition

getRequired

public java.lang.String getRequired(java.lang.String layoutMode,
                                    java.lang.String mode)
Description copied from interface: WidgetDefinition
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".

Specified by:
getRequired in interface WidgetDefinition

getLabel

public java.lang.String getLabel(java.lang.String mode)
Description copied from interface: WidgetDefinition
Returns the label to use in a given mode.

Specified by:
getLabel in interface WidgetDefinition

getLabels

public java.util.Map<java.lang.String,java.lang.String> getLabels()
Description copied from interface: WidgetDefinition
Returns labels by mode.

Specified by:
getLabels in interface WidgetDefinition

getHelpLabel

public java.lang.String getHelpLabel(java.lang.String mode)
Description copied from interface: WidgetDefinition
Returns the help label to use in a given mode.

Specified by:
getHelpLabel in interface WidgetDefinition

getHelpLabels

public java.util.Map<java.lang.String,java.lang.String> getHelpLabels()
Description copied from interface: WidgetDefinition
Returns help labels by mode.

Specified by:
getHelpLabels in interface WidgetDefinition

isTranslated

public boolean isTranslated()
Description copied from interface: WidgetDefinition
Returns true if all labels are messages that need to be translated.

Default is true.

Specified by:
isTranslated in interface WidgetDefinition

getProperties

public java.util.Map<java.lang.String,java.io.Serializable> getProperties(java.lang.String layoutMode,
                                                                          java.lang.String mode)
Description copied from interface: WidgetDefinition
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.

Specified by:
getProperties in interface WidgetDefinition

getProperties

public java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.io.Serializable>> getProperties()
Description copied from interface: WidgetDefinition
Returns properties by mode.

Specified by:
getProperties in interface WidgetDefinition

getWidgetModeProperties

public java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.io.Serializable>> getWidgetModeProperties()
Description copied from interface: WidgetDefinition
Returns properties by widget mode.

Specified by:
getWidgetModeProperties in interface WidgetDefinition

getSubWidgetDefinitions

public WidgetDefinition[] getSubWidgetDefinitions()
Description copied from interface: WidgetDefinition
Returns sub widget definitions.

Specified by:
getSubWidgetDefinitions in interface WidgetDefinition

getProperties

public static java.util.Map<java.lang.String,java.io.Serializable> getProperties(java.util.Map<java.lang.String,PropertiesDescriptor> map,
                                                                                 java.lang.String mode)

getProperties

public static java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.io.Serializable>> getProperties(java.util.Map<java.lang.String,PropertiesDescriptor> map)

Nuxeo Enterprise Platform 5.4

Copyright © 2010 Nuxeo SAS. All Rights Reserved.