public interface WidgetDefinition extends Serializable
A widget knows how to render itself in a given mode.
Modifier and Type | Field and Description |
---|---|
static String |
RENDERED_PROPERTY_NAME |
static String |
REQUIRED_PROPERTY_NAME |
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.
|
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.
|
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.
|
WidgetReference[] |
getSubWidgetReferences()
Returns sub widget definitions references.
|
String |
getType()
Returns the widget type used to render it.
|
Map<String,Map<String,Serializable>> |
getWidgetModeProperties()
Returns properties by widget mode.
|
boolean |
isHandlingLabels()
Returns true if the widget is handling his own labels display (usual
label and help label).
|
boolean |
isTranslated()
Returns true if all labels are messages that need to be translated.
|
void |
setFieldDefinitions(FieldDefinition[] fieldDefinitions) |
void |
setHandlingLabels(boolean handlingLabels) |
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 |
setSubWidgetReferences(WidgetReference[] subWidgets) |
void |
setTranslated(boolean translated) |
void |
setType(String type) |
void |
setWidgetModeProperties(Map<String,Map<String,Serializable>> properties) |
static final String RENDERED_PROPERTY_NAME
static final String REQUIRED_PROPERTY_NAME
String getName()
void setName(String name)
String getType()
void setType(String type)
FieldDefinition[] getFieldDefinitions()
void setFieldDefinitions(FieldDefinition[] fieldDefinitions)
String getMode(String layoutMode)
Can be a string or an EL ValueExpression.
layoutMode
- the layout (or parent widget) modeString getRequired(String layoutMode, String mode)
This value is computed from the property "required" in given mode. and can be a string or an EL ValueExpression. Defaults to "false".
boolean isTranslated()
Defaults to true.
void setTranslated(boolean translated)
isTranslated()
boolean isHandlingLabels()
Defaults to false.
void setHandlingLabels(boolean handlingLabels)
isHandlingLabels()
Map<String,Serializable> getProperties(String layoutMode, String 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.
Map<String,Map<String,Serializable>> getProperties()
void setProperties(Map<String,Map<String,Serializable>> properties)
Map<String,Map<String,Serializable>> getWidgetModeProperties()
void setWidgetModeProperties(Map<String,Map<String,Serializable>> properties)
WidgetDefinition[] getSubWidgetDefinitions()
void setSubWidgetDefinitions(WidgetDefinition[] subWidgets)
WidgetReference[] getSubWidgetReferences()
void setSubWidgetReferences(WidgetReference[] subWidgets)
WidgetSelectOption[] getSelectOptions()
void setSelectOptions(WidgetSelectOption[] selectOptions)
Map<String,List<RenderingInfo>> getRenderingInfos()
Useful for preview management where some configuration needs to be changed: what's changed can be set as rendering information here to be displayed.
List<RenderingInfo> getRenderingInfos(String mode)
void setRenderingInfos(Map<String,List<RenderingInfo>> renderingInfos)
WidgetDefinition clone()
Useful for conversion of widget definition during export.
Copyright © 2012 Nuxeo SA. All Rights Reserved.