Interface WidgetDefinition
-
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
WidgetDefinitionImpl
public interface WidgetDefinition extends Serializable
Widget definition interface.A widget knows how to render itself in a given mode.
- Author:
- Anahide Tchertchian
-
-
Field Summary
Fields Modifier and Type Field Description static String
RENDERED_PROPERTY_NAME
static String
REQUIRED_PROPERTY_NAME
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description WidgetDefinition
clone()
Returns a clone instance of this widget definition.List<String>
getAliases()
Return alias names for this widget definition (useful for compatibility on old widget names).Map<String,Map<String,Serializable>>
getControls()
Returns controls by mode.Map<String,Serializable>
getControls(String layoutMode, String mode)
Returns controls for given mode.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.String
getTypeCategory()
Returns the type category to use when retrieving the corresponding widget type.Map<String,Map<String,Serializable>>
getWidgetModeProperties()
Returns properties by widget mode.boolean
isDynamic()
Returns true if this widget was generated from configuration on a service, and not generated on-the-fly using dynamic behaviors.boolean
isGlobal()
Returns true if the widget is defined globally (as opposed to being held by a layout definition).boolean
isHandlingLabels()
Deprecated.since 5.7: this was added prematurely, seegetControls()
for a more generic management of rendering controlsboolean
isTranslated()
Returns true if all labels are messages that need to be translated.void
setControls(Map<String,Map<String,Serializable>> controls)
Sets controls by mode on widget definition.void
setFieldDefinitions(FieldDefinition[] fieldDefinitions)
void
setGlobal(boolean global)
Sets the global status on this definition, depending on how it's been retrievd by the service.void
setHandlingLabels(boolean handlingLabels)
Deprecated.since 5.7: this was added prematurely, seesetControls(Map)
for a more generic management of rendering controlsvoid
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
setTypeCategory(String typeCat)
Sets the type category to use when retrieving the corresponding widget type.void
setWidgetModeProperties(Map<String,Map<String,Serializable>> properties)
-
-
-
Field Detail
-
RENDERED_PROPERTY_NAME
static final String RENDERED_PROPERTY_NAME
- See Also:
- Constant Field Values
-
REQUIRED_PROPERTY_NAME
static final String REQUIRED_PROPERTY_NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
getName
String getName()
Returns the widget name used to identify it within a layout.
-
setName
void setName(String name)
- Since:
- 5.5
-
getType
String getType()
Returns the widget type used to render it.
-
setType
void setType(String type)
- Since:
- 5.5
-
getTypeCategory
String getTypeCategory()
Returns the type category to use when retrieving the corresponding widget type.- Since:
- 5.7.3
-
setTypeCategory
void setTypeCategory(String typeCat)
Sets the type category to use when retrieving the corresponding widget type.- Since:
- 5.7.3
-
getFieldDefinitions
FieldDefinition[] getFieldDefinitions()
Returns the list of fields managed by this widget.
-
setFieldDefinitions
void setFieldDefinitions(FieldDefinition[] fieldDefinitions)
- Since:
- 5.5
-
getMode
String getMode(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.
-
getRequired
String getRequired(String layoutMode, 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".
-
isTranslated
boolean isTranslated()
Returns true if all labels are messages that need to be translated.Defaults to true.
-
setTranslated
void setTranslated(boolean translated)
- Since:
- 5.5
- See Also:
isTranslated()
-
isHandlingLabels
@Deprecated boolean isHandlingLabels()
Deprecated.since 5.7: this was added prematurely, seegetControls()
for a more generic management of rendering controlsReturns true if the widget is handling his own labels display (usual label and help label). This can be checked by the layout template to render the widget using both label and widget usual places.Defaults to false.
- Since:
- 5.6
-
setHandlingLabels
@Deprecated void setHandlingLabels(boolean handlingLabels)
Deprecated.since 5.7: this was added prematurely, seesetControls(Map)
for a more generic management of rendering controls- Since:
- 5.6
- See Also:
isHandlingLabels()
-
getProperties
Map<String,Serializable> getProperties(String layoutMode, 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
Map<String,Map<String,Serializable>> getProperties()
Returns properties by mode.
-
setProperties
void setProperties(Map<String,Map<String,Serializable>> properties)
- Since:
- 5.5
-
getWidgetModeProperties
Map<String,Map<String,Serializable>> getWidgetModeProperties()
Returns properties by widget mode.
-
setWidgetModeProperties
void setWidgetModeProperties(Map<String,Map<String,Serializable>> properties)
- Since:
- 5.5
-
getControls
Map<String,Serializable> getControls(String layoutMode, String mode)
Returns controls for given mode.- Since:
- 5.7
- See Also:
getControls()
-
getControls
Map<String,Map<String,Serializable>> getControls()
Returns controls by mode.Controls are property-like markers on widget instances, expect these are not forwarded to the underlying rendering object (like the JSF component attributes).
This makes it possible to keep "flags" on widgets that can be checked by parent widget or layout, for instance "addForm" or "handlingLabels" markers.
- Since:
- 5.7
-
setControls
void setControls(Map<String,Map<String,Serializable>> controls)
Sets controls by mode on widget definition.- Since:
- 5.7
-
getSubWidgetDefinitions
WidgetDefinition[] getSubWidgetDefinitions()
Returns sub widget definitions.
-
setSubWidgetDefinitions
void setSubWidgetDefinitions(WidgetDefinition[] subWidgets)
- Since:
- 5.5
-
getSubWidgetReferences
WidgetReference[] getSubWidgetReferences()
Returns sub widget definitions references.- Since:
- 5.6
-
setSubWidgetReferences
void setSubWidgetReferences(WidgetReference[] subWidgets)
- Since:
- 5.6
-
getSelectOptions
WidgetSelectOption[] getSelectOptions()
Returns the select options for this widget.- Since:
- 5.4.2
-
setSelectOptions
void setSelectOptions(WidgetSelectOption[] selectOptions)
- Since:
- 5.5
-
getRenderingInfos
Map<String,List<RenderingInfo>> getRenderingInfos()
Returns the map of rendering information per mode.Useful for preview management where some configuration needs to be changed: what's changed can be set as rendering information here to be displayed.
- Since:
- 5.5
-
getRenderingInfos
List<RenderingInfo> getRenderingInfos(String mode)
Returns the list of rendering information for given mode.- Since:
- 5.5
-
setRenderingInfos
void setRenderingInfos(Map<String,List<RenderingInfo>> renderingInfos)
- Since:
- 5.5
-
getAliases
List<String> getAliases()
Return alias names for this widget definition (useful for compatibility on old widget names).- Since:
- 6.0
-
isGlobal
boolean isGlobal()
Returns true if the widget is defined globally (as opposed to being held by a layout definition).- Since:
- 6.0
-
setGlobal
void setGlobal(boolean global)
Sets the global status on this definition, depending on how it's been retrievd by the service.- Since:
- 6.0
-
isDynamic
boolean isDynamic()
Returns true if this widget was generated from configuration on a service, and not generated on-the-fly using dynamic behaviors.- Since:
- 6.0
-
clone
WidgetDefinition clone()
Returns a clone instance of this widget definition.Useful for conversion of widget definition during export.
- Since:
- 5.5
-
-