public class WidgetDefinitionImpl extends Object implements WidgetDefinition
Useful to compute widgets independently from the layout service.
| Modifier and Type | Field and Description |
|---|---|
protected List<String> |
aliases |
protected Map<String,Map<String,Serializable>> |
controls |
protected boolean |
dynamic |
protected FieldDefinition[] |
fieldDefinitions |
protected boolean |
global |
protected boolean |
handlingLabels
Deprecated.
since 5.7: use
controls instead |
protected Map<String,String> |
helpLabels |
protected Map<String,String> |
labels |
protected Map<String,String> |
modes |
protected String |
name |
protected Map<String,Map<String,Serializable>> |
properties |
protected Map<String,List<RenderingInfo>> |
renderingInfos |
protected WidgetSelectOption[] |
selectOptions |
protected WidgetReference[] |
subWidgetReferences |
protected WidgetDefinition[] |
subWidgets |
protected boolean |
translated |
protected String |
type |
protected String |
typeCategory |
protected Map<String,Map<String,Serializable>> |
widgetModeProperties |
RENDERED_PROPERTY_NAME, REQUIRED_PROPERTY_NAME| Modifier | Constructor and Description |
|---|---|
protected |
WidgetDefinitionImpl() |
|
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.
|
boolean |
equals(Object obj) |
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.
|
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.
|
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()
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 |
setAliases(List<String> aliases) |
void |
setControls(Map<String,Map<String,Serializable>> controls)
Sets controls by mode on widget definition.
|
void |
setDynamic(boolean dynamic) |
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) |
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[] subWidgetReferences) |
void |
setTranslated(boolean translated) |
void |
setType(String type) |
void |
setTypeCategory(String typeCategory)
Sets the type category to use when retrieving the corresponding widget type.
|
void |
setWidgetModeProperties(Map<String,Map<String,Serializable>> widgetModeProperties) |
String |
toString() |
protected String typeCategory
protected Map<String,String> helpLabels
protected boolean translated
@Deprecated protected boolean handlingLabels
controls insteadprotected FieldDefinition[] fieldDefinitions
protected Map<String,Map<String,Serializable>> properties
protected Map<String,Map<String,Serializable>> widgetModeProperties
protected WidgetDefinition[] subWidgets
protected WidgetReference[] subWidgetReferences
protected WidgetSelectOption[] selectOptions
protected Map<String,List<RenderingInfo>> renderingInfos
protected boolean dynamic
protected boolean global
protected WidgetDefinitionImpl()
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()
WidgetDefinitiongetFieldDefinitions in interface WidgetDefinitionpublic void setFieldDefinitions(FieldDefinition[] fieldDefinitions)
setFieldDefinitions in interface WidgetDefinitionpublic String getHelpLabel(String mode)
WidgetDefinitiongetHelpLabel in interface WidgetDefinitionpublic Map<String,String> getHelpLabels()
WidgetDefinitiongetHelpLabels in interface WidgetDefinitionpublic void setHelpLabels(Map<String,String> helpLabels)
setHelpLabels in interface WidgetDefinitionpublic String getLabel(String mode)
WidgetDefinitiongetLabel in interface WidgetDefinitionpublic Map<String,String> getLabels()
WidgetDefinitiongetLabels in interface WidgetDefinitionpublic void setLabels(Map<String,String> labels)
setLabels in interface WidgetDefinitionpublic String getMode(String layoutMode)
WidgetDefinitionCan be a string or an EL ValueExpression.
getMode in interface WidgetDefinitionlayoutMode - the layout (or parent widget) modepublic void setModes(Map<String,String> modes)
setModes in interface WidgetDefinitionpublic String getName()
WidgetDefinitiongetName in interface WidgetDefinitionpublic void setName(String name)
setName in interface WidgetDefinitionpublic Map<String,Serializable> getProperties(String layoutMode, String mode)
WidgetDefinitionA 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 WidgetDefinitionpublic Map<String,Map<String,Serializable>> getProperties()
WidgetDefinitiongetProperties in interface WidgetDefinitionpublic void setProperties(Map<String,Map<String,Serializable>> properties)
setProperties in interface WidgetDefinitionpublic Map<String,Map<String,Serializable>> getWidgetModeProperties()
WidgetDefinitiongetWidgetModeProperties in interface WidgetDefinitionpublic void setWidgetModeProperties(Map<String,Map<String,Serializable>> widgetModeProperties)
setWidgetModeProperties in interface WidgetDefinitionpublic Map<String,Serializable> getControls(String layoutMode, String mode)
WidgetDefinitiongetControls in interface WidgetDefinitionWidgetDefinition.getControls()public Map<String,Map<String,Serializable>> getControls()
WidgetDefinitionControls 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.
getControls in interface WidgetDefinitionpublic void setControls(Map<String,Map<String,Serializable>> controls)
WidgetDefinitionsetControls in interface WidgetDefinitionpublic String getRequired(String layoutMode, String mode)
WidgetDefinitionThis 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 WidgetDefinitionpublic WidgetDefinition[] getSubWidgetDefinitions()
WidgetDefinitiongetSubWidgetDefinitions in interface WidgetDefinitionpublic void setSubWidgetDefinitions(WidgetDefinition[] subWidgets)
setSubWidgetDefinitions in interface WidgetDefinitionpublic WidgetReference[] getSubWidgetReferences()
WidgetDefinitiongetSubWidgetReferences in interface WidgetDefinitionpublic void setSubWidgetReferences(WidgetReference[] subWidgetReferences)
setSubWidgetReferences in interface WidgetDefinitionpublic String getType()
WidgetDefinitiongetType in interface WidgetDefinitionpublic void setType(String type)
setType in interface WidgetDefinitionpublic String getTypeCategory()
WidgetDefinitiongetTypeCategory in interface WidgetDefinitionpublic void setTypeCategory(String typeCategory)
WidgetDefinitionsetTypeCategory in interface WidgetDefinitionpublic boolean isTranslated()
WidgetDefinitionDefaults to true.
isTranslated in interface WidgetDefinitionpublic void setTranslated(boolean translated)
setTranslated in interface WidgetDefinitionWidgetDefinition.isTranslated()public boolean isHandlingLabels()
WidgetDefinitionDefaults to false.
isHandlingLabels in interface WidgetDefinitionpublic void setHandlingLabels(boolean handlingLabels)
setHandlingLabels in interface WidgetDefinitionWidgetDefinition.isHandlingLabels()public static Map<String,Serializable> getProperties(Map<String,Map<String,Serializable>> properties, String mode)
public WidgetSelectOption[] getSelectOptions()
WidgetDefinitiongetSelectOptions in interface WidgetDefinitionpublic void setSelectOptions(WidgetSelectOption[] selectOptions)
setSelectOptions in interface WidgetDefinitionpublic Map<String,List<RenderingInfo>> getRenderingInfos()
WidgetDefinitionUseful 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 WidgetDefinitionpublic void setRenderingInfos(Map<String,List<RenderingInfo>> renderingInfos)
setRenderingInfos in interface WidgetDefinitionpublic static List<RenderingInfo> getRenderingInfos(Map<String,List<RenderingInfo>> infos, String mode)
public List<RenderingInfo> getRenderingInfos(String mode)
WidgetDefinitiongetRenderingInfos in interface WidgetDefinitionpublic boolean isDynamic()
WidgetDefinitionisDynamic in interface WidgetDefinitionpublic void setDynamic(boolean dynamic)
public boolean isGlobal()
WidgetDefinitionisGlobal in interface WidgetDefinitionpublic void setGlobal(boolean global)
WidgetDefinitionsetGlobal in interface WidgetDefinitionpublic List<String> getAliases()
WidgetDefinitiongetAliases in interface WidgetDefinitionpublic void setAliases(List<String> aliases)
public WidgetDefinition clone()
WidgetDefinitionUseful for conversion of widget definition during export.
clone in interface WidgetDefinitionclone in class ObjectCopyright © 2019 Nuxeo. All rights reserved.