org.kuali.rice.krad.uif.layout
Class LayoutManagerBase

java.lang.Object
  extended by org.kuali.rice.krad.uif.component.ConfigurableBase
      extended by org.kuali.rice.krad.uif.layout.LayoutManagerBase
All Implemented Interfaces:
Serializable, Configurable, LayoutManager
Direct Known Subclasses:
BoxLayoutManager, GridLayoutManager, StackedLayoutManager

public abstract class LayoutManagerBase
extends ConfigurableBase
implements LayoutManager

Base class for all layout managers

Provides general properties of all layout managers, such as the unique id, rendering template, and style settings

Author:
Kuali Rice Team (rice.collab@kuali.org)
See Also:
Serialized Form

Constructor Summary
LayoutManagerBase()
           
 
Method Summary
 void addStyleClass(String styleClass)
          This method adds a single style class to the list of css style classes on this component
 void appendToStyle(String styleRules)
          Appends to the inline style set on this layoutManager
 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
 List<String> getCssClasses()
          CSS style class(s) to be applied to the area (div) the layout manager generates for the items
 String getId()
          The unique id (within a given tree) for the layout manager instance
 Set<String> getPropertiesForReferenceCopy()
          Set of property names for the layout manager base for which on the property value reference should be copied.
 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
 String getStyleClassesAsString()
          Builds the HTML class attribute string by combining the styleClasses list with a space delimiter
 Class<? extends Container> getSupportedContainer()
          Default Impl
 String getTemplate()
          The path to the JSP file that should be called to invoke the layout manager
 String getTemplateName()
          The name of the layout manager template
 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 setCssClasses(List<String> cssClasses)
          Setter for the layout manager div style class
 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(String styleClasses)
          Sets the styleClasses list from the given string that has the classes delimited by space.
 void setTemplate(String template)
          Setter for the layout managers template
 void setTemplateName(String templateName)
          Setter for the layout managers template name
 
Methods inherited from class org.kuali.rice.krad.uif.component.ConfigurableBase
getExpressionGraph, getPropertyExpression, getPropertyExpressions, getRefreshExpressionGraph, setExpressionGraph, setPropertyExpressions, setRefreshExpressionGraph
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.kuali.rice.krad.uif.component.Configurable
getExpressionGraph, getPropertyExpression, getPropertyExpressions, getRefreshExpressionGraph, setExpressionGraph, setPropertyExpressions, setRefreshExpressionGraph
 

Constructor Detail

LayoutManagerBase

public LayoutManagerBase()
Method Detail

performInitialization

public void performInitialization(View view,
                                  Object model,
                                  Container container)
Description copied from interface: LayoutManager
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.

Specified by:
performInitialization in interface LayoutManager
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:
LayoutManager.performInitialization(org.kuali.rice.krad.uif.view.View, java.lang.Object, org.kuali.rice.krad.uif.container.Container)

performApplyModel

public void performApplyModel(View view,
                              Object model,
                              Container container)
Description copied from interface: LayoutManager
Called after the initialize phase to perform conditional logic based on the model data

Specified by:
performApplyModel in interface LayoutManager
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
See Also:
LayoutManager.performApplyModel(org.kuali.rice.krad.uif.view.View, java.lang.Object, org.kuali.rice.krad.uif.container.Container)

performFinalize

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

Specified by:
performFinalize in interface LayoutManager
Parameters:
view - - view instance that should be finalized for rendering
model - - top level object containing the data
container - - Container the layout manager applies to
See Also:
LayoutManager.performFinalize(org.kuali.rice.krad.uif.view.View, java.lang.Object, org.kuali.rice.krad.uif.container.Container)

getPropertiesForReferenceCopy

public Set<String> getPropertiesForReferenceCopy()
Set of property names for the layout manager base for which on the property value reference should be copied. Subclasses can override this but should include a call to super

Specified by:
getPropertiesForReferenceCopy in interface LayoutManager
Returns:
Set property names for which only the value reference should be copied
See Also:
LayoutManager.getPropertiesForReferenceCopy()

getSupportedContainer

public Class<? extends Container> getSupportedContainer()
Default Impl

Specified by:
getSupportedContainer in interface LayoutManager
Returns:
Class container class supported
See Also:
LayoutManager.getSupportedContainer()

getComponentsForLifecycle

public List<Component> getComponentsForLifecycle()
Description copied from interface: LayoutManager
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

Specified by:
getComponentsForLifecycle in interface LayoutManager
Returns:
List child components
See Also:
LayoutManager.getComponentsForLifecycle()

getComponentPrototypes

public List<Component> getComponentPrototypes()
Description copied from interface: LayoutManager
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.

Specified by:
getComponentPrototypes in interface LayoutManager
Returns:
List child component prototypes
See Also:
LayoutManager.getComponentPrototypes()

getId

public String getId()
Description copied from interface: LayoutManager
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

Specified by:
getId in interface LayoutManager
Returns:
String id
See Also:
LayoutManager.getId()

setId

public void setId(String id)
Description copied from interface: LayoutManager
Sets the unique id (within a given tree) for the layout manager

Specified by:
setId in interface LayoutManager
Parameters:
id - - string to set as the layout manager id
See Also:
LayoutManager.setId(java.lang.String)

getTemplate

public String getTemplate()
Description copied from interface: LayoutManager
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'

Specified by:
getTemplate in interface LayoutManager
Returns:
String representing the template path
See Also:
LayoutManager.getTemplate()

setTemplate

public void setTemplate(String template)
Description copied from interface: LayoutManager
Setter for the layout managers template

Specified by:
setTemplate in interface LayoutManager
See Also:
LayoutManager.setTemplate(java.lang.String)

getTemplateName

public String getTemplateName()
The name of the layout manager template

Returns:
template name
See Also:
getTemplate()

setTemplateName

public void setTemplateName(String templateName)
Setter for the layout managers template name

Parameters:
templateName -

getStyle

public String getStyle()
Description copied from interface: LayoutManager
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;'

Specified by:
getStyle in interface LayoutManager
Returns:
String css style string
See Also:
LayoutManager.getStyle()

setStyle

public void setStyle(String style)
Description copied from interface: LayoutManager
Setter for the layout manager div style

Specified by:
setStyle in interface LayoutManager
See Also:
LayoutManager.setStyle(java.lang.String)

getCssClasses

public List<String> getCssClasses()
Description copied from interface: LayoutManager
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'

Specified by:
getCssClasses in interface LayoutManager
Returns:
List css style classes to apply
See Also:
LayoutManager.getCssClasses()

setCssClasses

public void setCssClasses(List<String> cssClasses)
Description copied from interface: LayoutManager
Setter for the layout manager div style class

Specified by:
setCssClasses in interface LayoutManager
See Also:
LayoutManager.setCssClasses(java.util.List)

getStyleClassesAsString

public String getStyleClassesAsString()
Builds the HTML class attribute string by combining the styleClasses list with a space delimiter

Returns:
String class attribute string

setStyleClasses

public void setStyleClasses(String styleClasses)
Sets the styleClasses list from the given string that has the classes delimited by space. This is a convenience for configuration. If a child bean needs to inherit the classes from the parent, it should configure as a list and use merge="true"

Parameters:
styleClasses -

addStyleClass

public void addStyleClass(String styleClass)
Description copied from interface: LayoutManager
This method adds a single style class to the list of css style classes on this component

Specified by:
addStyleClass in interface LayoutManager
See Also:
LayoutManager.addStyleClass(java.lang.String)

appendToStyle

public void appendToStyle(String styleRules)
Description copied from interface: LayoutManager
Appends to the inline style set on this layoutManager

Specified by:
appendToStyle in interface LayoutManager
See Also:
LayoutManager.appendToStyle(java.lang.String)

getContext

public Map<String,Object> getContext()
Description copied from interface: LayoutManager
Context map for the layout manager

Specified by:
getContext in interface LayoutManager
Returns:
Map context
See Also:
LayoutManager.getContext()

setContext

public void setContext(Map<String,Object> context)
Description copied from interface: LayoutManager
Setter for the context Map

Specified by:
setContext in interface LayoutManager
See Also:
LayoutManager.setContext(java.util.Map)

pushObjectToContext

public void pushObjectToContext(String objectName,
                                Object object)
Description copied from interface: LayoutManager
Places the given object into the context Map for the layout manager with the given name

Specified by:
pushObjectToContext in interface LayoutManager
See Also:
LayoutManager.pushObjectToContext(java.lang.String, java.lang.Object)

getPropertyReplacers

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

Specified by:
getPropertyReplacers in interface LayoutManager
Returns:
List replacers to evaluate
See Also:
LayoutManager.getPropertyReplacers()

setPropertyReplacers

public void setPropertyReplacers(List<PropertyReplacer> propertyReplacers)
Description copied from interface: LayoutManager
Setter for the layout managers property substitutions

Specified by:
setPropertyReplacers in interface LayoutManager
See Also:
LayoutManager.setPropertyReplacers(java.util.List)


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