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

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.GridLayoutManager
All Implemented Interfaces:
Serializable, Configurable, LayoutManager
Direct Known Subclasses:
TableLayoutManager

public class GridLayoutManager
extends LayoutManagerBase

Layout manager that organizes its components in a table based grid

Items are laid out from left to right (with each item taking up one column) until the configured number of columns is reached. If the item count is greater than the number of columns, a new row will be created to render the remaining items (and so on until all items are placed). Labels for the fields can be pulled out (default) and rendered as a separate column. The manager also supports the column span and row span options for the field items. If not specified the default is 1.

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

Constructor Summary
GridLayoutManager()
           
 
Method Summary
 String getFirstLineStyle()
           
 int getNumberOfColumns()
          Indicates the number of columns that should make up one row of data
 Class<? extends Container> getSupportedContainer()
          Default Impl
 boolean isApplyAlternatingRowStyles()
          Indicates whether alternating row styles should be applied
 boolean isApplyDefaultCellWidths()
          Indicates whether the manager should default the cell widths
 boolean isRenderAlternatingHeaderColumns()
          Indicates whether header columns (th for tables) should be rendered for every other item (alternating)
 boolean isSuppressLineWrapping()
          Indicates whether the number of columns for the table data should match the number of fields given in the container's items list (so that each field takes up one column without wrapping), this overrides the configured numberOfColumns
 void performFinalize(View view, Object model, Container container)
          The following finalization is performed: If suppressLineWrapping is true, sets the number of columns to the container's items list size
 void setApplyAlternatingRowStyles(boolean applyAlternatingRowStyles)
          Setter for the alternating row styles indicator
 void setApplyDefaultCellWidths(boolean applyDefaultCellWidths)
          Setter for the default cell width indicator
 void setFirstLineStyle(String firstLineStyle)
          Style class given to the first line in the collection
 void setNumberOfColumns(int numberOfColumns)
          Setter for the number of columns (each row)
 void setRenderAlternatingHeaderColumns(boolean renderAlternatingHeaderColumns)
          Setter for the render alternating header columns indicator
 void setSuppressLineWrapping(boolean suppressLineWrapping)
          Setter for the suppressLineWrapping indicator
 
Methods inherited from class org.kuali.rice.krad.uif.layout.LayoutManagerBase
addStyleClass, getComponentPrototypes, getComponentsForLifecycle, getContext, getId, getPropertiesForReferenceCopy, getPropertyReplacers, getStyle, getStyleClasses, getStyleClassesAsString, getTemplate, performApplyModel, performInitialization, 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

GridLayoutManager

public GridLayoutManager()
Method Detail

performFinalize

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

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)

getSupportedContainer

public Class<? extends Container> getSupportedContainer()
Description copied from class: LayoutManagerBase
Default Impl

Specified by:
getSupportedContainer in interface LayoutManager
Overrides:
getSupportedContainer in class LayoutManagerBase
Returns:
Class container class supported
See Also:
org.kuali.rice.krad.uif.layout.ContainerAware#getSupportedContainer()

getNumberOfColumns

public int getNumberOfColumns()
Indicates the number of columns that should make up one row of data

If the item count is greater than the number of columns, a new row will be created to render the remaining items (and so on until all items are placed).

Note this does not include any generated columns by the layout manager, so the final column count could be greater (if label fields are separate).

Returns:

setNumberOfColumns

public void setNumberOfColumns(int numberOfColumns)
Setter for the number of columns (each row)

Parameters:
numberOfColumns -

isSuppressLineWrapping

public boolean isSuppressLineWrapping()
Indicates whether the number of columns for the table data should match the number of fields given in the container's items list (so that each field takes up one column without wrapping), this overrides the configured numberOfColumns

If set to true during the initialize phase the number of columns will be set to the size of the container's field list, if false the configured number of columns is used

Returns:
boolean true if the column count should match the container's field count, false to use the configured number of columns

setSuppressLineWrapping

public void setSuppressLineWrapping(boolean suppressLineWrapping)
Setter for the suppressLineWrapping indicator

Parameters:
suppressLineWrapping -

isApplyAlternatingRowStyles

public boolean isApplyAlternatingRowStyles()
Indicates whether alternating row styles should be applied

Indicator to layout manager templates to apply alternating row styles. See the configured template for the actual style classes used

Returns:
boolean true if alternating styles should be applied, false if all rows should have the same style

setApplyAlternatingRowStyles

public void setApplyAlternatingRowStyles(boolean applyAlternatingRowStyles)
Setter for the alternating row styles indicator

Parameters:
applyAlternatingRowStyles -

isApplyDefaultCellWidths

public boolean isApplyDefaultCellWidths()
Indicates whether the manager should default the cell widths

If true, the manager will set the cell width by equally dividing by the number of columns

Returns:
boolean true if default cell widths should be applied, false if no defaults should be applied

setApplyDefaultCellWidths

public void setApplyDefaultCellWidths(boolean applyDefaultCellWidths)
Setter for the default cell width indicator

Parameters:
applyDefaultCellWidths -

isRenderAlternatingHeaderColumns

public boolean isRenderAlternatingHeaderColumns()
Indicates whether header columns (th for tables) should be rendered for every other item (alternating)

If true the first cell of each row will be rendered as an header, with every other cell in the row as a header

Returns:
boolean true if alternating headers should be rendered, false if not

setRenderAlternatingHeaderColumns

public void setRenderAlternatingHeaderColumns(boolean renderAlternatingHeaderColumns)
Setter for the render alternating header columns indicator

Parameters:
renderAlternatingHeaderColumns -

getFirstLineStyle

public String getFirstLineStyle()

setFirstLineStyle

public void setFirstLineStyle(String firstLineStyle)
Style class given to the first line in the collection

Parameters:
firstLineStyle -


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