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()
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 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 Map<String,Serializable> getControls(String layoutMode, String mode)
WidgetDefinition
getControls
in interface WidgetDefinition
WidgetDefinition.getControls()
public Map<String,Map<String,Serializable>> getControls()
WidgetDefinition
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.
getControls
in interface WidgetDefinition
public void setControls(Map<String,Map<String,Serializable>> controls)
WidgetDefinition
setControls
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 WidgetReference[] getSubWidgetReferences()
WidgetDefinition
getSubWidgetReferences
in interface WidgetDefinition
public void setSubWidgetReferences(WidgetReference[] subWidgetReferences)
setSubWidgetReferences
in interface WidgetDefinition
public String getType()
WidgetDefinition
getType
in interface WidgetDefinition
public void setType(String type)
setType
in interface WidgetDefinition
public String getTypeCategory()
WidgetDefinition
getTypeCategory
in interface WidgetDefinition
public void setTypeCategory(String typeCategory)
WidgetDefinition
setTypeCategory
in interface WidgetDefinition
public boolean isTranslated()
WidgetDefinition
Defaults to true.
isTranslated
in interface WidgetDefinition
public void setTranslated(boolean translated)
setTranslated
in interface WidgetDefinition
WidgetDefinition.isTranslated()
public boolean isHandlingLabels()
WidgetDefinition
Defaults to false.
isHandlingLabels
in interface WidgetDefinition
public void setHandlingLabels(boolean handlingLabels)
setHandlingLabels
in interface WidgetDefinition
WidgetDefinition.isHandlingLabels()
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 boolean isDynamic()
WidgetDefinition
isDynamic
in interface WidgetDefinition
public void setDynamic(boolean dynamic)
public boolean isGlobal()
WidgetDefinition
isGlobal
in interface WidgetDefinition
public void setGlobal(boolean global)
WidgetDefinition
setGlobal
in interface WidgetDefinition
public List<String> getAliases()
WidgetDefinition
getAliases
in interface WidgetDefinition
public void setAliases(List<String> aliases)
public WidgetDefinition clone()
WidgetDefinition
Useful for conversion of widget definition during export.
clone
in interface WidgetDefinition
clone
in class Object
Copyright © 2018 Nuxeo. All rights reserved.