public class LayoutImpl extends Object implements Layout
Modifier and Type | Field and Description |
---|---|
protected int |
columns |
protected LayoutDefinition |
definition |
protected String |
definitionId |
protected String |
devTemplate |
protected boolean |
dynamic |
protected String |
id |
protected String |
mode |
protected String |
name |
protected Map<String,Serializable> |
properties |
protected LayoutRow[] |
rows |
protected String |
template |
protected String |
type |
protected String |
typeCategory |
protected String |
valueName |
protected Map<String,Widget> |
widgetMap |
Modifier | Constructor and Description |
---|---|
protected |
LayoutImpl() |
|
LayoutImpl(String name,
String mode,
String template,
List<LayoutRow> rows,
int columns,
Map<String,Serializable> properties,
String definitionId) |
|
LayoutImpl(String name,
String mode,
String template,
Map<String,Widget> widgets,
Map<String,Serializable> properties,
String definitionId) |
Modifier and Type | Method and Description |
---|---|
protected void |
computeWidgetMap() |
int |
getColumns()
Returns the maximum number of columns.
|
LayoutDefinition |
getDefinition()
Returns the definition from which this layout instance was generated.
|
String |
getDevTemplate()
Returns the template to use for dev mode.
|
String |
getId()
Returns the layout id, unique within the facelet context.
|
String |
getMode()
Returns the layout mode.
|
String |
getName()
Returns the layout name used to identify it within the layout service.
|
Map<String,Serializable> |
getProperties()
Get properties to use in this mode.
|
Serializable |
getProperty(String name)
Returns property with given name in this mode.
|
LayoutRow[] |
getRows()
Returns the table of widgets.
|
String |
getTagConfigId()
Returns the unique identifier of this widget to be used in tag configuration.
|
String |
getTemplate()
Returns the template used to render widgets.
|
String |
getType()
Returns the layout type.
|
String |
getTypeCategory()
Returns the layout type category.
|
String |
getValueName()
Gets the value name used to compute widget attributes.
|
Widget |
getWidget(String name)
Returns widget with given name.
|
Map<String,Widget> |
getWidgetMap()
Returns a widget map, with widget name as key.
|
boolean |
isDynamic()
Return true if this layout was generated from configuration on a service, and not generated on-the-fly using
dynamic behaviors.
|
void |
setDefinition(LayoutDefinition definition) |
void |
setDevTemplate(String devTemplate) |
void |
setDynamic(boolean dynamic) |
void |
setId(String id)
Sets the layout id, unique within the facelet context.
|
void |
setProperty(String name,
Serializable value)
Sets property with given name on the layout.
|
void |
setType(String type) |
void |
setTypeCategory(String typeCategory) |
void |
setValueName(String valueName)
Sets the value name used to compute widget bindings.
|
String |
toString() |
protected String typeCategory
protected String devTemplate
protected int columns
protected Map<String,Serializable> properties
protected String definitionId
protected boolean dynamic
protected LayoutDefinition definition
protected LayoutImpl()
public LayoutImpl(String name, String mode, String template, List<LayoutRow> rows, int columns, Map<String,Serializable> properties, String definitionId)
protected void computeWidgetMap()
public String getId()
Layout
public String getTagConfigId()
Layout
In JSF, layouts are rendered dynamically and re-use the tag configuration of the tag rendering them when adding handlers to the facelet hierarchy. Since this tag identifier is used to perform some kind of caching on the JSF layer, it needs to change when the layout definition changes, so that JSF components are not mistaken for another one.
This identifier is unique to a given layout definition and always returns the same result given the same layout definition.
getTagConfigId
in interface Layout
public void setId(String id)
Layout
public String getName()
Layout
public String getTemplate()
Layout
getTemplate
in interface Layout
public LayoutRow[] getRows()
Layout
This list is computed from the LayoutDefinition
rows.
Widgets that are not found are ignored.
public int getColumns()
Layout
getColumns
in interface Layout
public Widget getWidget(String name)
Layout
Only widgets of the first level are retrieved.
public Map<String,Widget> getWidgetMap()
Layout
Only widgets of the first level are retrieved.
getWidgetMap
in interface Layout
public Map<String,Serializable> getProperties()
Layout
The way that properties will be mapped to rendered components is managed by the widget type.
getProperties
in interface Layout
public Serializable getProperty(String name)
Layout
getProperty
in interface Layout
name
- the property name.public void setProperty(String name, Serializable value)
Layout
setProperty
in interface Layout
name
- the property name.value
- the property value or null if not found.public String getValueName()
Layout
getValueName
in interface Layout
public void setValueName(String valueName)
Layout
setValueName
in interface Layout
public String getTypeCategory()
Layout
getTypeCategory
in interface Layout
public void setTypeCategory(String typeCategory)
public boolean isDynamic()
Layout
public void setDynamic(boolean dynamic)
public String getDevTemplate()
Layout
Is retrieved from layout definition templates, or from layout type templates, using the BuiltinModes.DEV
.
getDevTemplate
in interface Layout
public void setDevTemplate(String devTemplate)
public LayoutDefinition getDefinition()
Layout
Useful in dev mode to show the corresponding configuration in the UI.
getDefinition
in interface Layout
public void setDefinition(LayoutDefinition definition)
Copyright © 2017 Nuxeo. All rights reserved.