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

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

public class BoxLayoutManager
extends LayoutManagerBase

Layout manager that organizes components in a single row (horizontal) or column (vertical)

Although a table based template could be used, setup is done to also support a CSS based template. The items in the Container instance are rendered sequentially wrapping each one with a span element. The padding property can be configured to space the elements as needed. To achieve a vertical orientation, the span style is set to block. Additional styling can be set for the items by using the itemSpanStyle property.

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

Constructor Summary
BoxLayoutManager()
           
 
Method Summary
 String getItemStyle()
          Used by the render to set the style on the span element that wraps the item.
 List<String> getItemStyleClasses()
          List of style classes that should be applied to each span that wraps the item in the layout
 String getItemStyleClassesAsString()
          Builds the HTML class attribute string by combining the item styleClasses list with a space delimiter
 UifConstants.Orientation getOrientation()
          Indicates whether the components should be rendered in a horizontal or vertical column
 String getPadding()
          Amount of separation between each item
 boolean isLayoutFieldErrors()
           
 void performFinalize(View view, Object model, Container container)
          The last phase before the view is rendered.
 void performInitialization(View view, Object model, Container container)
          The following initialization is performed: Set the itemSpanStyle
 void setItemStyle(String itemStyle)
          Setter for the span style
 void setItemStyleClasses(List<String> itemStyleClasses)
          Setter for the list of style classes that should apply to each item span
 void setLayoutFieldErrors(boolean layoutFieldErrors)
           
 void setOrientation(UifConstants.Orientation orientation)
          Setter for the orientation for layout
 void setPadding(String padding)
          Setter for the item padding
 
Methods inherited from class org.kuali.rice.krad.uif.layout.LayoutManagerBase
addStyleClass, getComponentPrototypes, getComponentsForLifecycle, getContext, getId, getPropertiesForReferenceCopy, getPropertyReplacers, getStyle, getStyleClasses, getStyleClassesAsString, getSupportedContainer, getTemplate, performApplyModel, pushObjectToContext, setContext, setId, setPropertyReplacers, setStyle, setStyleClasses, setStyleClasses, setTemplate
 
Methods inherited from class org.kuali.rice.krad.uif.component.ConfigurableBase
getPropertyExpression, getPropertyExpressions, setPropertyExpressions
 
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
getPropertyExpression, getPropertyExpressions, setPropertyExpressions
 

Constructor Detail

BoxLayoutManager

public BoxLayoutManager()
Method Detail

performInitialization

public void performInitialization(View view,
                                  Object model,
                                  Container container)
The following initialization is performed:

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

getOrientation

public UifConstants.Orientation getOrientation()
Indicates whether the components should be rendered in a horizontal or vertical column

Returns:
Orientation orientation configured for layout

setOrientation

public void setOrientation(UifConstants.Orientation orientation)
Setter for the orientation for layout

Parameters:
orientation -

getPadding

public String getPadding()
Amount of separation between each item

For horizontal orientation, this will be the right padding for each item. For vertical, it will be the bottom padding for each item. The value can be a fixed length (like px) or percentage

Returns:

setPadding

public void setPadding(String padding)
Setter for the item padding

Parameters:
padding -

getItemStyle

public String getItemStyle()
Used by the render to set the style on the span element that wraps the item. By using a wrapping span the items can be aligned based on the orientation and given the correct padding

Returns:
String css style string

setItemStyle

public void setItemStyle(String itemStyle)
Setter for the span style

Parameters:
itemStyle -

getItemStyleClasses

public List<String> getItemStyleClasses()
List of style classes that should be applied to each span that wraps the item in the layout

Returns:
List

setItemStyleClasses

public void setItemStyleClasses(List<String> itemStyleClasses)
Setter for the list of style classes that should apply to each item span

Parameters:
itemStyleClasses -

getItemStyleClassesAsString

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

Returns:
String class attribute string

isLayoutFieldErrors

public boolean isLayoutFieldErrors()
Returns:
the layoutFieldErrors

setLayoutFieldErrors

public void setLayoutFieldErrors(boolean layoutFieldErrors)
Parameters:
layoutFieldErrors - the layoutFieldErrors to set


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