public class WidgetImpl extends Object implements Widget
| Modifier and Type | Field and Description |
|---|---|
protected Map<String,Serializable> |
controls |
protected WidgetDefinition |
definition |
protected String |
definitionId |
protected boolean |
dynamic |
protected FieldDefinition[] |
fields |
protected boolean |
global |
protected boolean |
handlingLabels
Deprecated.
since 5.7: use
controls instead |
protected String |
helpLabel |
protected String |
id |
protected String |
label |
protected String |
layoutName |
protected int |
level |
protected String |
mode |
protected String |
name |
protected Map<String,Serializable> |
properties |
protected List<RenderingInfo> |
renderingInfos |
protected boolean |
required |
protected WidgetSelectOption[] |
selectOptions |
protected Widget[] |
subWidgets |
protected boolean |
translated |
protected String |
type |
protected String |
typeCategory |
protected String |
valueName |
| Modifier | Constructor and Description |
|---|---|
protected |
WidgetImpl() |
|
WidgetImpl(String layoutName,
String name,
String mode,
String type,
String valueName,
FieldDefinition[] fields,
String label,
String helpLabel,
boolean translated,
boolean handlingLabels,
Map<String,Serializable> properties,
boolean required,
Widget[] subWidgets,
int level,
WidgetSelectOption[] selectOptions,
String definitionId,
List<RenderingInfo> renderingInfos) |
|
WidgetImpl(String layoutName,
String name,
String mode,
String type,
String valueName,
FieldDefinition[] fields,
String label,
String helpLabel,
boolean translated,
Map<String,Serializable> properties,
boolean required,
Widget[] subWidgets,
int level,
WidgetSelectOption[] selectOptions,
String definitionId) |
|
WidgetImpl(String layoutName,
String name,
String mode,
String type,
String valueName,
FieldDefinition[] fields,
String label,
String helpLabel,
boolean translated,
Map<String,Serializable> properties,
boolean required,
Widget[] subWidgets,
int level,
WidgetSelectOption[] selectOptions,
String definitionId,
List<RenderingInfo> renderingInfos) |
| Modifier and Type | Method and Description |
|---|---|
Serializable |
getControl(String name)
Returns control with given name.
|
Map<String,Serializable> |
getControls()
Returns controls on this widget.
|
WidgetDefinition |
getDefinition()
Returns the definition from which this widget instance was generated.
|
FieldDefinition[] |
getFieldDefinitions()
Returns the list of fields managed by this widget.
|
String |
getHelpLabel()
Return the help label to use in this mode.
|
String |
getId()
Returns the widget id, unique within the facelet context.
|
String |
getLabel()
Returns the label to use in this mode.
|
String |
getLayoutName()
Returns the layout name.
|
int |
getLevel()
Returns the widget level in the widget hierarchy.
|
String |
getMode()
Returns the widget mode.
|
String |
getName()
Returns the widget name used to identify it within a layout.
|
Map<String,Serializable> |
getProperties()
Get properties to use in this mode.
|
Serializable |
getProperty(String name)
Returns property with given name in this mode.
|
List<RenderingInfo> |
getRenderingInfos()
Returns the list of rendering information.
|
WidgetSelectOption[] |
getSelectOptions()
Returns the select options for this widget.
|
Widget[] |
getSubWidgets()
Returns sub widgets.
|
String |
getTagConfigId()
Returns the unique identifier of this widget to be used in tag configuration.
|
String |
getType()
Returns the widget type used to render it.
|
String |
getTypeCategory()
Returns the widget type category.
|
String |
getValueName()
Gets the value name used to compute tag attributes.
|
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 |
isRequired()
Returns true if the widget is required.
|
boolean |
isTranslated()
Returns true if all labels are messages that need to be translated.
|
void |
setControl(String name,
Serializable value)
Sets control with given name and value.
|
void |
setControls(Map<String,Serializable> controls) |
void |
setDefinition(WidgetDefinition definition) |
void |
setDynamic(boolean dynamic) |
void |
setGlobal(boolean global) |
void |
setId(String id)
Sets the widget id, unique within the facelet context.
|
void |
setProperty(String name,
Serializable value)
Sets property with given name on the layout.
|
void |
setTypeCategory(String typeCategory) |
void |
setValueName(String valueName)
Sets the value name used to compute tag attributes.
|
String |
toString() |
protected String layoutName
protected String typeCategory
protected FieldDefinition[] fields
protected Widget[] subWidgets
protected Map<String,Serializable> properties
protected Map<String,Serializable> controls
protected boolean required
protected boolean translated
@Deprecated protected boolean handlingLabels
controls insteadprotected int level
protected WidgetSelectOption[] selectOptions
protected List<RenderingInfo> renderingInfos
protected String definitionId
protected boolean dynamic
protected boolean global
protected WidgetDefinition definition
protected WidgetImpl()
public WidgetImpl(String layoutName, String name, String mode, String type, String valueName, FieldDefinition[] fields, String label, String helpLabel, boolean translated, Map<String,Serializable> properties, boolean required, Widget[] subWidgets, int level, WidgetSelectOption[] selectOptions, String definitionId)
public WidgetImpl(String layoutName, String name, String mode, String type, String valueName, FieldDefinition[] fields, String label, String helpLabel, boolean translated, Map<String,Serializable> properties, boolean required, Widget[] subWidgets, int level, WidgetSelectOption[] selectOptions, String definitionId, List<RenderingInfo> renderingInfos)
public WidgetImpl(String layoutName, String name, String mode, String type, String valueName, FieldDefinition[] fields, String label, String helpLabel, boolean translated, boolean handlingLabels, Map<String,Serializable> properties, boolean required, Widget[] subWidgets, int level, WidgetSelectOption[] selectOptions, String definitionId, List<RenderingInfo> renderingInfos)
public String getId()
Widgetpublic String getTagConfigId()
WidgetgetTagConfigId in interface WidgetLayout#getTagConfigId()}.public void setId(String id)
Widgetpublic String getLayoutName()
WidgetgetLayoutName in interface Widgetpublic String getName()
Widgetpublic String getMode()
WidgetThis mode can be different from the layout mode.
public String getType()
Widgetpublic String getTypeCategory()
WidgetgetTypeCategory in interface Widgetpublic void setTypeCategory(String typeCategory)
public String getLabel()
Widgetpublic String getHelpLabel()
WidgetgetHelpLabel in interface Widgetpublic boolean isTranslated()
WidgetDefaults to false.
isTranslated in interface Widgetpublic boolean isHandlingLabels()
WidgetDefaults to false.
isHandlingLabels in interface Widgetpublic Map<String,Serializable> getProperties()
WidgetThe way that properties will be mapped to rendered components is managed by the widget type.
getProperties in interface Widgetpublic Serializable getProperty(String name)
WidgetgetProperty in interface Widgetname - the property name.public void setProperty(String name, Serializable value)
WidgetsetProperty in interface Widgetname - the property name.value - the property value or null if not found.public Map<String,Serializable> getControls()
WidgetgetControls in interface WidgetWidgetDefinition.getControls()public Serializable getControl(String name)
WidgetgetControl in interface WidgetWidgetDefinition.getControls()public void setControl(String name, Serializable value)
WidgetsetControl in interface WidgetWidgetDefinition.getControls()public void setControls(Map<String,Serializable> controls)
public boolean isRequired()
WidgetThis is a short link for the "required" property, already evaluated from an EL expression (if needed). Defaults to false.
isRequired in interface Widgetpublic FieldDefinition[] getFieldDefinitions()
WidgetgetFieldDefinitions in interface Widgetpublic Widget[] getSubWidgets()
WidgetgetSubWidgets in interface Widgetpublic String getValueName()
WidgetgetValueName in interface Widgetpublic void setValueName(String valueName)
WidgetsetValueName in interface Widgetpublic int getLevel()
WidgetFor instance a standard widget will have a level of 0, and its potential subwidgets will have a level of 1.
public WidgetSelectOption[] getSelectOptions()
WidgetgetSelectOptions in interface Widgetpublic List<RenderingInfo> getRenderingInfos()
WidgetUseful 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 Widgetpublic boolean isDynamic()
Widgetpublic void setDynamic(boolean dynamic)
public boolean isGlobal()
Widgetpublic void setGlobal(boolean global)
public WidgetDefinition getDefinition()
WidgetUseful in dev mode to show the corresponding configuration in the UI.
getDefinition in interface Widgetpublic void setDefinition(WidgetDefinition definition)
Copyright © 2019 Nuxeo. All rights reserved.