org.kuali.rice.krad.uif.layout.collections
Class TableRowBuilder

java.lang.Object
  extended by org.kuali.rice.krad.uif.layout.collections.TableRowBuilder
All Implemented Interfaces:
Serializable

public class TableRowBuilder
extends Object
implements Serializable

Builds out a collection line into a table row. TODO: This have duplicate logic from table layout manager, the goal is to move all logic from the layout manager to this class

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

Nested Class Summary
 class TableRowBuilder.ColumnCollector
          Helper class for collecting columsn that will make up a table row.
 
Constructor Summary
TableRowBuilder()
          Empty Constructor.
TableRowBuilder(CollectionGroup collectionGroup, LineBuilderContext lineBuilderContext)
          Constructor taking the collection group instance and context for the line.
 
Method Summary
protected  void addGroupingColumn(TableRowBuilder.ColumnCollector columnCollector)
          Adds the grouping column to the given column collector.
protected  void addLineSelectColumn(TableRowBuilder.ColumnCollector columnCollector)
          Adds the line select column to the given column collector.
protected  void addSequenceColumn(TableRowBuilder.ColumnCollector columnCollector)
          Adds the sequence column to the given column collector.
 TableRow buildRow()
          Takes the context given for the line and builds out a table row instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TableRowBuilder

public TableRowBuilder()
Empty Constructor.


TableRowBuilder

public TableRowBuilder(CollectionGroup collectionGroup,
                       LineBuilderContext lineBuilderContext)
Constructor taking the collection group instance and context for the line.

Parameters:
collectionGroup - collection group the table row is being built for
lineBuilderContext - components and other configuration for the line to build
Method Detail

buildRow

public TableRow buildRow()
Takes the context given for the line and builds out a table row instance.

The row is built out based on a determined order of special columns (sequence, line selection) and then each field from the configured items list. Since the placement of the action column is configurable, it is handled by the TableRowBuilder.ColumnCollector

Returns:
table row instance for the line

addSequenceColumn

protected void addSequenceColumn(TableRowBuilder.ColumnCollector columnCollector)
Adds the sequence column to the given column collector.

Sequence column is created with a new message component for the add line, and by copying TableLayoutManager.getSequenceFieldPrototype() for existing rows.

Parameters:
columnCollector - object collecting the columns for the row

addLineSelectColumn

protected void addLineSelectColumn(TableRowBuilder.ColumnCollector columnCollector)
Adds the line select column to the given column collector.

The line select column is used to select rows for an action (such as lookup return).

Parameters:
columnCollector - object collecting the columns for the row

addGroupingColumn

protected void addGroupingColumn(TableRowBuilder.ColumnCollector columnCollector)
Adds the grouping column to the given column collector.

The grouping column is used when table grouping is on to render a header for the group. The data tables plugin will pull the value from this column and render the header row.

Parameters:
columnCollector - object collecting the columns for the row


Copyright © 2005–2015 The Kuali Foundation. All rights reserved.