Nuxeo ECM Projects 5.4.3-SNAPSHOT

org.nuxeo.ecm.platform.forms.layout.api.impl
Class LayoutDefinitionImpl

java.lang.Object
  extended by org.nuxeo.ecm.platform.forms.layout.api.impl.LayoutDefinitionImpl
All Implemented Interfaces:
Serializable, LayoutDefinition

public class LayoutDefinitionImpl
extends Object
implements LayoutDefinition

Default implementation for a layout definition.

Useful to compute layouts independently from the layout service.

Since:
5.4
Author:
Anahide Tchertchian
See Also:
Serialized Form

Constructor Summary
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)
           
 
Method Summary
 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.
 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.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LayoutDefinitionImpl

public LayoutDefinitionImpl(String name,
                            String template,
                            WidgetDefinition widgetDefinition)

LayoutDefinitionImpl

public LayoutDefinitionImpl(String name,
                            Map<String,Map<String,Serializable>> properties,
                            Map<String,String> templates,
                            List<LayoutRowDefinition> rows,
                            List<WidgetDefinition> widgetDefinitions)

LayoutDefinitionImpl

public LayoutDefinitionImpl(String name,
                            Map<String,Map<String,Serializable>> properties,
                            Map<String,String> templates,
                            LayoutRowDefinition[] rows,
                            Map<String,WidgetDefinition> widgets)
Method Detail

getColumns

public int getColumns()
Description copied from interface: LayoutDefinition
Returns the maximum number of columns.

Specified by:
getColumns in interface LayoutDefinition

getName

public String getName()
Description copied from interface: LayoutDefinition
Returns the layout name used to identify it within the layout service.

Specified by:
getName in interface LayoutDefinition

getProperties

public Map<String,Serializable> getProperties(String layoutMode)
Description copied from interface: LayoutDefinition
Returns a map of properties to use in a given mode.

Specified by:
getProperties in interface LayoutDefinition

getProperties

public Map<String,Map<String,Serializable>> getProperties()
Description copied from interface: LayoutDefinition
Returns a map of properties by mode.

Specified by:
getProperties in interface LayoutDefinition

getRows

public LayoutRowDefinition[] getRows()
Description copied from interface: LayoutDefinition
Returns the list of widget names to use at a given row.

For instance, this could describe a layout like: [['title'], ['description'], ['creationDate', '', 'modificationDate'], ['subject']].

Specified by:
getRows in interface LayoutDefinition

getTemplate

public String getTemplate(String mode)
Description copied from interface: LayoutDefinition
Returns template to use in a given mode.

Specified by:
getTemplate in interface LayoutDefinition

getTemplates

public Map<String,String> getTemplates()
Description copied from interface: LayoutDefinition
Returns templates by mode

Specified by:
getTemplates in interface LayoutDefinition

getWidgetDefinition

public WidgetDefinition getWidgetDefinition(String name)
Description copied from interface: LayoutDefinition
Returns the widget definition with given name.

Returns null if a widget with this name is not found within the layout.

Specified by:
getWidgetDefinition in interface LayoutDefinition

Nuxeo ECM Projects 5.4.3-SNAPSHOT

Copyright © 2011 Nuxeo SAS. All Rights Reserved.