Class LayoutImpl
- All Implemented Interfaces:
Serializable
,Layout
- Author:
- Anahide Tchertchian
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionprotected int
protected LayoutDefinition
protected String
protected String
protected boolean
protected String
protected String
protected String
protected Map<String,
Serializable> protected LayoutRow[]
protected String
protected String
protected String
protected String
-
Constructor Summary
ModifierConstructorDescriptionprotected
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) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
int
Returns the maximum number of columns.Returns the definition from which this layout instance was generated.Returns the template to use for dev mode.getId()
Returns the layout id, unique within the facelet context.getMode()
Returns the layout mode.getName()
Returns the layout name used to identify it within the layout service.Get properties to use in this mode.getProperty
(String name) Returns property with given name in this mode.getRows()
Returns the table of widgets.Returns the unique identifier of this widget to be used in tag configuration.Returns the template used to render widgets.getType()
Returns the layout type.Returns the layout type category.Gets the value name used to compute widget attributes.Returns widget with given name.Returns a widget map, with widget name as key.boolean
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
Sets the layout id, unique within the facelet context.void
setProperty
(String name, Serializable value) Sets property with given name on the layout.void
void
setTypeCategory
(String typeCategory) void
setValueName
(String valueName) Sets the value name used to compute widget bindings.toString()
-
Field Details
-
id
-
name
-
type
-
typeCategory
-
mode
-
template
-
devTemplate
-
rows
-
widgetMap
-
columns
protected int columns -
properties
-
definitionId
-
valueName
-
dynamic
protected boolean dynamic -
definition
-
-
Constructor Details
-
LayoutImpl
protected LayoutImpl() -
LayoutImpl
public LayoutImpl(String name, String mode, String template, List<LayoutRow> rows, int columns, Map<String, Serializable> properties, String definitionId) - Since:
- 5.5
-
LayoutImpl
public LayoutImpl(String name, String mode, String template, Map<String, Widget> widgets, Map<String, Serializable> properties, String definitionId) - Since:
- 8.1
-
-
Method Details
-
computeWidgetMap
protected void computeWidgetMap() -
getId
Description copied from interface:Layout
Returns the layout id, unique within the facelet context. -
getTagConfigId
Description copied from interface:Layout
Returns the unique identifier of this widget to be used in tag configuration.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.
- Specified by:
getTagConfigId
in interfaceLayout
-
setId
Description copied from interface:Layout
Sets the layout id, unique within the facelet context. -
getName
Description copied from interface:Layout
Returns the layout name used to identify it within the layout service. -
getMode
Description copied from interface:Layout
Returns the layout mode. -
getTemplate
Description copied from interface:Layout
Returns the template used to render widgets.- Specified by:
getTemplate
in interfaceLayout
-
getRows
Description copied from interface:Layout
Returns the table of widgets.This list is computed from the
LayoutDefinition
rows.Widgets that are not found are ignored.
-
getColumns
public int getColumns()Description copied from interface:Layout
Returns the maximum number of columns.- Specified by:
getColumns
in interfaceLayout
-
getWidget
Description copied from interface:Layout
Returns widget with given name.Only widgets of the first level are retrieved.
-
getWidgetMap
Description copied from interface:Layout
Returns a widget map, with widget name as key.Only widgets of the first level are retrieved.
- Specified by:
getWidgetMap
in interfaceLayout
-
getProperties
Description copied from interface:Layout
Get properties to use in this mode.The way that properties will be mapped to rendered components is managed by the widget type.
- Specified by:
getProperties
in interfaceLayout
-
getProperty
Description copied from interface:Layout
Returns property with given name in this mode.- Specified by:
getProperty
in interfaceLayout
- Parameters:
name
- the property name.- Returns:
- the property value or null if not found.
-
setProperty
Description copied from interface:Layout
Sets property with given name on the layout. If there is already a property with this name on the layout, it will be overridden.- Specified by:
setProperty
in interfaceLayout
- Parameters:
name
- the property name.value
- the property value or null if not found.
-
getValueName
Description copied from interface:Layout
Gets the value name used to compute widget attributes.- Specified by:
getValueName
in interfaceLayout
-
setValueName
Description copied from interface:Layout
Sets the value name used to compute widget bindings.- Specified by:
setValueName
in interfaceLayout
-
getType
Description copied from interface:Layout
Returns the layout type. -
setType
- Since:
- 6.0
-
getTypeCategory
Description copied from interface:Layout
Returns the layout type category.- Specified by:
getTypeCategory
in interfaceLayout
- Since:
- 6.0
-
setTypeCategory
- Since:
- 6.0
-
toString
-
isDynamic
public boolean isDynamic()Description copied from interface:Layout
Return true if this layout was generated from configuration on a service, and not generated on-the-fly using dynamic behaviors. -
setDynamic
public void setDynamic(boolean dynamic) -
getDevTemplate
Description copied from interface:Layout
Returns the template to use for dev mode.Is retrieved from layout definition templates, or from layout type templates, using the
BuiltinModes.DEV
.- Specified by:
getDevTemplate
in interfaceLayout
-
setDevTemplate
-
getDefinition
Description copied from interface:Layout
Returns the definition from which this layout instance was generated.Useful in dev mode to show the corresponding configuration in the UI.
- Specified by:
getDefinition
in interfaceLayout
-
setDefinition
-