public class WidgetDefinitionImpl extends Object implements WidgetDefinition
Useful to compute widgets independently from the layout service.
RENDERED_PROPERTY_NAME, REQUIRED_PROPERTY_NAME
Constructor and Description |
---|
WidgetDefinitionImpl(String name,
String type,
Map<String,String> labels,
Map<String,String> helpLabels,
boolean translated,
Map<String,String> modes,
FieldDefinition[] fieldDefinitions,
Map<String,Map<String,Serializable>> properties,
Map<String,Map<String,Serializable>> widgetModeProperties,
WidgetDefinition[] subWidgets) |
WidgetDefinitionImpl(String name,
String type,
Map<String,String> labels,
Map<String,String> helpLabels,
boolean translated,
Map<String,String> modes,
FieldDefinition[] fieldDefinitions,
Map<String,Map<String,Serializable>> properties,
Map<String,Map<String,Serializable>> widgetModeProperties,
WidgetDefinition[] subWidgets,
WidgetSelectOption[] selectOptions) |
WidgetDefinitionImpl(String name,
String type,
Map<String,String> labels,
Map<String,String> helpLabels,
boolean translated,
Map<String,String> modes,
List<FieldDefinition> fieldDefinitions,
Map<String,Map<String,Serializable>> properties,
Map<String,Map<String,Serializable>> widgetModeProperties,
List<WidgetDefinition> subWidgets) |
WidgetDefinitionImpl(String name,
String type,
String label,
String helpLabel,
boolean translated,
Map<String,String> modes,
List<FieldDefinition> fieldDefinitions,
Map<String,Serializable> properties,
List<WidgetDefinition> subWidgets) |
Modifier and Type | Method and Description |
---|---|
WidgetDefinition |
clone()
Returns a clone instance of this widget definition.
|
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,Serializable> |
getProperties(Map<String,Map<String,Serializable>> properties,
String mode) |
Map<String,Serializable> |
getProperties(String layoutMode,
String mode)
Returns a map of properties to use in a given mode.
|
Map<String,List<RenderingInfo>> |
getRenderingInfos()
Returns the map of rendering information per mode.
|
static List<RenderingInfo> |
getRenderingInfos(Map<String,List<RenderingInfo>> infos,
String mode) |
List<RenderingInfo> |
getRenderingInfos(String mode)
Returns the list of rendering information for 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 |
setFieldDefinitions(FieldDefinition[] fieldDefinitions) |
void |
setHelpLabels(Map<String,String> helpLabels) |
void |
setLabels(Map<String,String> labels) |
void |
setModes(Map<String,String> modes) |
void |
setName(String name) |
void |
setProperties(Map<String,Map<String,Serializable>> properties) |
void |
setRenderingInfos(Map<String,List<RenderingInfo>> renderingInfos) |
void |
setSelectOptions(WidgetSelectOption[] selectOptions) |
void |
setSubWidgetDefinitions(WidgetDefinition[] subWidgets) |
void |
setTranslated(boolean translated) |
void |
setType(String type) |
void |
setWidgetModeProperties(Map<String,Map<String,Serializable>> widgetModeProperties) |
public WidgetDefinitionImpl(String name, String type, String label, String helpLabel, boolean translated, Map<String,String> modes, List<FieldDefinition> fieldDefinitions, Map<String,Serializable> properties, List<WidgetDefinition> subWidgets)
public WidgetDefinitionImpl(String name, String type, Map<String,String> labels, Map<String,String> helpLabels, boolean translated, Map<String,String> modes, List<FieldDefinition> fieldDefinitions, Map<String,Map<String,Serializable>> properties, Map<String,Map<String,Serializable>> widgetModeProperties, List<WidgetDefinition> subWidgets)
public WidgetDefinitionImpl(String name, String type, Map<String,String> labels, Map<String,String> helpLabels, boolean translated, Map<String,String> modes, FieldDefinition[] fieldDefinitions, Map<String,Map<String,Serializable>> properties, Map<String,Map<String,Serializable>> widgetModeProperties, WidgetDefinition[] subWidgets)
public WidgetDefinitionImpl(String name, String type, Map<String,String> labels, Map<String,String> helpLabels, boolean translated, Map<String,String> modes, FieldDefinition[] fieldDefinitions, Map<String,Map<String,Serializable>> properties, Map<String,Map<String,Serializable>> widgetModeProperties, WidgetDefinition[] subWidgets, WidgetSelectOption[] selectOptions)
public FieldDefinition[] getFieldDefinitions()
WidgetDefinition
getFieldDefinitions
in interface WidgetDefinition
public void setFieldDefinitions(FieldDefinition[] fieldDefinitions)
setFieldDefinitions
in interface WidgetDefinition
public String getHelpLabel(String mode)
WidgetDefinition
getHelpLabel
in interface WidgetDefinition
public Map<String,String> getHelpLabels()
WidgetDefinition
getHelpLabels
in interface WidgetDefinition
public void setHelpLabels(Map<String,String> helpLabels)
setHelpLabels
in interface WidgetDefinition
public String getLabel(String mode)
WidgetDefinition
getLabel
in interface WidgetDefinition
public Map<String,String> getLabels()
WidgetDefinition
getLabels
in interface WidgetDefinition
public void setLabels(Map<String,String> labels)
setLabels
in interface WidgetDefinition
public String getMode(String layoutMode)
WidgetDefinition
Can be a string or an EL ValueExpression.
getMode
in interface WidgetDefinition
layoutMode
- the layout (or parent widget) modepublic Map<String,String> getModes()
getModes
in interface WidgetDefinition
public void setModes(Map<String,String> modes)
setModes
in interface WidgetDefinition
public String getName()
WidgetDefinition
getName
in interface WidgetDefinition
public void setName(String name)
setName
in interface WidgetDefinition
public Map<String,Serializable> getProperties(String layoutMode, String mode)
WidgetDefinition
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
in interface WidgetDefinition
public Map<String,Map<String,Serializable>> getProperties()
WidgetDefinition
getProperties
in interface WidgetDefinition
public void setProperties(Map<String,Map<String,Serializable>> properties)
setProperties
in interface WidgetDefinition
public Map<String,Map<String,Serializable>> getWidgetModeProperties()
WidgetDefinition
getWidgetModeProperties
in interface WidgetDefinition
public void setWidgetModeProperties(Map<String,Map<String,Serializable>> widgetModeProperties)
setWidgetModeProperties
in interface WidgetDefinition
public String getRequired(String layoutMode, String mode)
WidgetDefinition
This value is computed from the property "required" in given mode. and can be a string or an EL ValueExpression. Defaults to "false".
getRequired
in interface WidgetDefinition
public WidgetDefinition[] getSubWidgetDefinitions()
WidgetDefinition
getSubWidgetDefinitions
in interface WidgetDefinition
public void setSubWidgetDefinitions(WidgetDefinition[] subWidgets)
setSubWidgetDefinitions
in interface WidgetDefinition
public String getType()
WidgetDefinition
getType
in interface WidgetDefinition
public void setType(String type)
setType
in interface WidgetDefinition
public boolean isTranslated()
WidgetDefinition
Default is true.
isTranslated
in interface WidgetDefinition
public void setTranslated(boolean translated)
setTranslated
in interface WidgetDefinition
public static Map<String,Serializable> getProperties(Map<String,Map<String,Serializable>> properties, String mode)
public WidgetSelectOption[] getSelectOptions()
WidgetDefinition
getSelectOptions
in interface WidgetDefinition
public void setSelectOptions(WidgetSelectOption[] selectOptions)
setSelectOptions
in interface WidgetDefinition
public Map<String,List<RenderingInfo>> getRenderingInfos()
WidgetDefinition
Useful for preview management where some configuration needs to be changed: what's changed can be set as rendering information here to be displayed.
getRenderingInfos
in interface WidgetDefinition
public void setRenderingInfos(Map<String,List<RenderingInfo>> renderingInfos)
setRenderingInfos
in interface WidgetDefinition
public static List<RenderingInfo> getRenderingInfos(Map<String,List<RenderingInfo>> infos, String mode)
public List<RenderingInfo> getRenderingInfos(String mode)
WidgetDefinition
getRenderingInfos
in interface WidgetDefinition
public WidgetDefinition clone()
WidgetDefinition
Useful for conversion of widget definition during export.
clone
in interface WidgetDefinition
clone
in class Object
Copyright © 2011 Nuxeo SA. All Rights Reserved.