public class LayoutDefinitionImpl extends Object implements LayoutDefinition
Useful to compute layouts independently from the layout service.
Constructor and Description |
---|
LayoutDefinitionImpl(String name,
Map<String,Map<String,Serializable>> properties,
Map<String,String> templates,
LayoutRowDefinition[] rows,
Map<String,WidgetDefinition> widgets) |
LayoutDefinitionImpl(String name,
Map<String,Map<String,Serializable>> properties,
Map<String,String> templates,
List<LayoutRowDefinition> rows,
List<WidgetDefinition> widgetDefinitions) |
LayoutDefinitionImpl(String name,
String template,
WidgetDefinition widgetDefinition) |
Modifier and Type | Method and Description |
---|---|
LayoutDefinition |
clone()
Returns a clone instance of this layout definition.
|
int |
getColumns()
Returns the maximum number of columns.
|
String |
getName()
Returns the layout name used to identify it within the layout service.
|
Map<String,Map<String,Serializable>> |
getProperties()
Returns a map of properties by mode.
|
Map<String,Serializable> |
getProperties(String layoutMode)
Returns a map of properties to use in a given mode.
|
Map<String,List<RenderingInfo>> |
getRenderingInfos()
Returns the map of rendering information per mode.
|
List<RenderingInfo> |
getRenderingInfos(String mode)
Returns the list of rendering information for given mode.
|
LayoutRowDefinition[] |
getRows()
Returns the list of widget names to use at a given row.
|
String |
getTemplate(String mode)
Returns template to use in a given mode.
|
Map<String,String> |
getTemplates()
Returns templates by mode
|
WidgetDefinition |
getWidgetDefinition(String name)
Returns the widget definition with given name.
|
boolean |
isEmpty()
Returns true if all widget references in this layout are empty
|
void |
setName(String name) |
void |
setProperties(Map<String,Map<String,Serializable>> properties) |
void |
setRenderingInfos(Map<String,List<RenderingInfo>> renderingInfos) |
void |
setRows(LayoutRowDefinition[] rows) |
void |
setTemplates(Map<String,String> templates) |
public LayoutDefinitionImpl(String name, String template, WidgetDefinition widgetDefinition)
public LayoutDefinitionImpl(String name, Map<String,Map<String,Serializable>> properties, Map<String,String> templates, List<LayoutRowDefinition> rows, List<WidgetDefinition> widgetDefinitions)
public LayoutDefinitionImpl(String name, Map<String,Map<String,Serializable>> properties, Map<String,String> templates, LayoutRowDefinition[] rows, Map<String,WidgetDefinition> widgets)
public int getColumns()
LayoutDefinition
getColumns
in interface LayoutDefinition
public String getName()
LayoutDefinition
getName
in interface LayoutDefinition
public void setName(String name)
setName
in interface LayoutDefinition
public Map<String,Serializable> getProperties(String layoutMode)
LayoutDefinition
getProperties
in interface LayoutDefinition
public Map<String,Map<String,Serializable>> getProperties()
LayoutDefinition
getProperties
in interface LayoutDefinition
public void setProperties(Map<String,Map<String,Serializable>> properties)
setProperties
in interface LayoutDefinition
public LayoutRowDefinition[] getRows()
LayoutDefinition
For instance, this could describe a layout like: [['title'], ['description'], ['creationDate', '', 'modificationDate'], ['subject']].
getRows
in interface LayoutDefinition
public void setRows(LayoutRowDefinition[] rows)
setRows
in interface LayoutDefinition
public String getTemplate(String mode)
LayoutDefinition
getTemplate
in interface LayoutDefinition
public Map<String,String> getTemplates()
LayoutDefinition
getTemplates
in interface LayoutDefinition
public void setTemplates(Map<String,String> templates)
setTemplates
in interface LayoutDefinition
public WidgetDefinition getWidgetDefinition(String name)
LayoutDefinition
Returns null if a widget with this name is not found within the layout.
getWidgetDefinition
in interface LayoutDefinition
public Map<String,List<RenderingInfo>> getRenderingInfos()
LayoutDefinition
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 LayoutDefinition
public void setRenderingInfos(Map<String,List<RenderingInfo>> renderingInfos)
setRenderingInfos
in interface LayoutDefinition
public List<RenderingInfo> getRenderingInfos(String mode)
LayoutDefinition
getRenderingInfos
in interface LayoutDefinition
public LayoutDefinition clone()
LayoutDefinition
Useful for conversion of layout definition during export.
clone
in interface LayoutDefinition
clone
in class Object
public boolean isEmpty()
LayoutDefinition
isEmpty
in interface LayoutDefinition
Copyright © 2013 Nuxeo SA. All Rights Reserved.