Nuxeo ECM Projects 5.4.3-SNAPSHOT

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:
Serializable, WidgetDefinition

public class WidgetDescriptor
extends 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.
 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.
static Map<String,Map<String,Serializable>> getProperties(Map<String,PropertiesDescriptor> map)
           
static Map<String,Serializable> getProperties(Map<String,PropertiesDescriptor> map, String 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.
 void setSelectOptions(DocumentFragment selectOptionsDOM)
           
 
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 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 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 String getMode(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 Map<String,String> getModes()
Specified by:
getModes in interface WidgetDefinition

getRequired

public String getRequired(String layoutMode,
                          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 String getLabel(String mode)
Description copied from interface: WidgetDefinition
Returns the label to use in a given mode.

Specified by:
getLabel in interface WidgetDefinition

getLabels

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

Specified by:
getLabels in interface WidgetDefinition

getHelpLabel

public String getHelpLabel(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 Map<String,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 Map<String,Serializable> getProperties(String layoutMode,
                                              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 Map<String,Map<String,Serializable>> getProperties()
Description copied from interface: WidgetDefinition
Returns properties by mode.

Specified by:
getProperties in interface WidgetDefinition

getWidgetModeProperties

public Map<String,Map<String,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 Map<String,Serializable> getProperties(Map<String,PropertiesDescriptor> map,
                                                     String mode)

getProperties

public static Map<String,Map<String,Serializable>> getProperties(Map<String,PropertiesDescriptor> map)

getSelectOptions

public WidgetSelectOption[] getSelectOptions()
Description copied from interface: WidgetDefinition
Returns the select options for this widget.

Specified by:
getSelectOptions in interface WidgetDefinition

setSelectOptions

public void setSelectOptions(DocumentFragment selectOptionsDOM)

Nuxeo ECM Projects 5.4.3-SNAPSHOT

Copyright © 2011 Nuxeo SAS. All Rights Reserved.