org.kuali.rice.krad.uif.layout
Interface LayoutManager

All Superinterfaces:
Configurable, Serializable
All Known Subinterfaces:
CollectionLayoutManager
All Known Implementing Classes:
BoxLayoutManager, GridLayoutManager, LayoutManagerBase, StackedLayoutManager, TableLayoutManager

public interface LayoutManager
extends Configurable, Serializable

Manages the rendering of Component instances within a Container

Author:
Kuali Rice Team (rice.collab@kuali.org)

Method Summary
 void addStyleClass(String styleClass)
          This method adds a single style class to the list of css style classes on this component
 List<Component> getComponentPrototypes()
          List of components that are maintained by the layout manager as prototypes for creating other component instances
 List<Component> getComponentsForLifecycle()
          List of components that are contained within the layout manager that should be sent through the lifecycle
 Map<String,Object> getContext()
          Context map for the layout manager
 String getId()
          The unique id (within a given tree) for the layout manager instance
 Set<String> getPropertiesForReferenceCopy()
          Used by the copy process to determine for which properties only the value reference should be copied (not a new copy instance).
 List<PropertyReplacer> getPropertyReplacers()
          List of PropertyReplacer instances that will be evaluated during the view lifecycle to conditional set properties on the LayoutManager based on expression evaluations
 String getStyle()
          CSS style string to be applied to the area (div) the layout manager generates for the items
 List<String> getStyleClasses()
          CSS style class(s) to be applied to the area (div) the layout manager generates for the items
 Class<? extends Container> getSupportedContainer()
          Determines what Container classes are supported by the LayoutManager
 String getTemplate()
          The path to the JSP file that should be called to invoke the layout manager
 void performApplyModel(View view, Object model, Container container)
          Called after the initialize phase to perform conditional logic based on the model data
 void performFinalize(View view, Object model, Container container)
          The last phase before the view is rendered.
 void performInitialization(View view, Object model, Container container)
          Should be called to initialize the layout manager
 void pushObjectToContext(String objectName, Object object)
          Places the given object into the context Map for the layout manager with the given name
 void setContext(Map<String,Object> context)
          Setter for the context Map
 void setId(String id)
          Sets the unique id (within a given tree) for the layout manager
 void setPropertyReplacers(List<PropertyReplacer> propertyReplacers)
          Setter for the layout managers property substitutions
 void setStyle(String style)
          Setter for the layout manager div style
 void setStyleClasses(List<String> styleClasses)
          Setter for the layout manager div style class
 void setTemplate(String template)
          Setter for the layout managers template
 
Methods inherited from interface org.kuali.rice.krad.uif.component.Configurable
getPropertyExpression, getPropertyExpressions, setPropertyExpressions
 

Method Detail

getId

String getId()
The unique id (within a given tree) for the layout manager instance

The id is used to identify a LayoutManager instance within the tree and can be used by renderers

Returns:
String id

setId

void setId(String id)
Sets the unique id (within a given tree) for the layout manager

Parameters:
id - - string to set as the layout manager id

getTemplate

String getTemplate()
The path to the JSP file that should be called to invoke the layout manager

The path should be relative to the web root. All layout manager templates receive the list of items of be placed, the configured layout manager, and the container to which the layout manager applies

e.g. '/krad/WEB-INF/jsp/tiles/boxLayout.jsp'

Returns:
String representing the template path

setTemplate

void setTemplate(String template)
Setter for the layout managers template

Parameters:
template -

performInitialization

void performInitialization(View view,
                           Object model,
                           Container container)
Should be called to initialize the layout manager

This is where layout managers can set defaults and setup other necessary state. The initialize method should only be called once per layout manager lifecycle and is invoked within the initialize phase of the view lifecylce.

Parameters:
view - - View instance the layout manager is a part of
model - - the object instance containing the view data
container - - Container the layout manager applies to
See Also:
ViewHelperService.performInitialization(org.kuali.rice.krad.uif.view.View, java.lang.Object)

performApplyModel

void performApplyModel(View view,
                       Object model,
                       Container container)
Called after the initialize phase to perform conditional logic based on the model data

Parameters:
view - - view instance to which the layout manager belongs
model - - Top level object containing the data (could be the form or a top level business object, dto)
container - - Container the layout manager applies to

performFinalize

void performFinalize(View view,
                     Object model,
                     Container container)
The last phase before the view is rendered. Here final preparations can be made based on the updated view state

Parameters:
view - - view instance that should be finalized for rendering
model - - top level object containing the data
container - - Container the layout manager applies to

getSupportedContainer

Class<? extends Container> getSupportedContainer()
Determines what Container classes are supported by the LayoutManager

Returns:
Class container class supported

getComponentsForLifecycle

List<Component> getComponentsForLifecycle()
List of components that are contained within the layout manager that should be sent through the lifecycle

Used by ViewHelperService for the various lifecycle callbacks

Returns:
List child components

getComponentPrototypes

List<Component> getComponentPrototypes()
List of components that are maintained by the layout manager as prototypes for creating other component instances

Prototypes are held for configuring how a component should be created during the lifecycle. An example of this are the fields in a collection group that are created for each collection record. They only participate in the initialize phase.

Returns:
List child component prototypes

getPropertiesForReferenceCopy

Set<String> getPropertiesForReferenceCopy()
Used by the copy process to determine for which properties only the value reference should be copied (not a new copy instance). Subclasses can define the properties for which only the reference should be copied

Returns:
Set property names for which only the value reference should be copied
See Also:
org.kuali.rice.krad.uif.util.ComponentUtils.copy(T)

getStyle

String getStyle()
CSS style string to be applied to the area (div) the layout manager generates for the items

Note the styleClass/style configured on the Container applies to all the container content (header, body, footer), while the styleClass/style configured on the LayoutManager only applies to the div surrounding the items placed by the manager (the container's body)

Any style override or additions can be specified with this attribute. This is used by the renderer to set the style attribute on the corresponding element.

e.g. 'color: #000000;text-decoration: underline;'

Returns:
String css style string

setStyle

void setStyle(String style)
Setter for the layout manager div style

Parameters:
style -

getStyleClasses

List<String> getStyleClasses()
CSS style class(s) to be applied to the area (div) the layout manager generates for the items

Note the styleClass/style configured on the Container applies to all the container content (header, body, footer), while the styleClass/style configured on the LayoutManager only applies to the div surrounding the items placed by the manager (the container's body)

Declares additional style classes for the div. Multiple classes are specified with a space delimiter. This is used by the renderer to set the class attribute on the corresponding element. The class(s) declared must be available in the common style sheets or the style sheets specified for the view

e.g. 'header left'

Returns:
List css style classes to apply

setStyleClasses

void setStyleClasses(List<String> styleClasses)
Setter for the layout manager div style class

Parameters:
styleClass -

addStyleClass

void addStyleClass(String styleClass)
This method adds a single style class to the list of css style classes on this component

Parameters:
style -

getContext

Map<String,Object> getContext()
Context map for the layout manager

Returns:
Map context
See Also:
org.kuali.rice.krad.uif.Component.getContext()

setContext

void setContext(Map<String,Object> context)
Setter for the context Map

Parameters:
context -
See Also:
org.kuali.rice.krad.uif.Component.setElContext(Map)

pushObjectToContext

void pushObjectToContext(String objectName,
                         Object object)
Places the given object into the context Map for the layout manager with the given name

See Also:
org.kuali.rice.krad.uif.Component.pushObjectToContext(String, Object)

getPropertyReplacers

List<PropertyReplacer> getPropertyReplacers()
List of PropertyReplacer instances that will be evaluated during the view lifecycle to conditional set properties on the LayoutManager based on expression evaluations

Returns:
List replacers to evaluate

setPropertyReplacers

void setPropertyReplacers(List<PropertyReplacer> propertyReplacers)
Setter for the layout managers property substitutions

Parameters:
propertyReplacers -


Copyright © 2005-2014 The Kuali Foundation. All Rights Reserved.