org.kuali.kfs.sys.document.web
Class AccountingLineViewColumns

java.lang.Object
  extended by org.kuali.kfs.sys.document.web.AccountingLineViewColumns
All Implemented Interfaces:
AccountingLineViewLineFillingElement, ElementNamable, ReadOnlyable, TableJoining

public class AccountingLineViewColumns
extends Object
implements AccountingLineViewLineFillingElement

A layout element that renders elements


Constructor Summary
AccountingLineViewColumns(AccountingLineViewColumnsDefinition definition, List<AccountingLineViewField> fields)
          Constructs a AccountingLineViewColumns
 
Method Summary
protected  AccountingLineTableCell createCellForField(AccountingLineViewField field)
          Creates the "field" cell for the given field
protected  AccountingLineTableCell createHeaderCellForField(AccountingLineViewField field)
          Creates a header cell for for the given field
protected  AccountingLineTableCell createPaddingCell()
          Creates an empty cell to pad out the place typically held for a cell
protected  List<AccountingLineTableRow> createRowsForFields()
          Creates rows for the inner tables for each field inside this columsn definition
 int getDisplayingFieldWidth()
          Always returns 1; this will build an inner table in one cell
 List<AccountingLineViewField> getFields()
          Gets the fields attribute.
 String getName()
          Returns the name of this element
 int getRequestedRowCount()
          The minimum number of rows this element needs if it is going to join a table
 boolean isReadOnly()
          Determines whether is element is entirely read only or not
 void joinRow(AccountingLineTableRow headerLabelRow, AccountingLineTableRow row)
          Joins the header row with a line filling cell, which includes within it an inner table that shows all the child fields
 void joinTable(List<AccountingLineTableRow> rows)
          An exception state; line filling elements can only join tables through lines
 void performFieldTransformations(List<AccountingLineFieldRenderingTransformation> fieldTransformations, AccountingLine accountingLine, Map unconvertedValues)
          Has fields perform the transformations
 void readOnlyize()
          Sets any renderable element within this table joining block to be read only
 void readOnlyizeReadOnlyBlocks(Set<String> readOnlyBlocks)
          Has each field readOnlyize
 void removeAllActionBlocks()
          Removes any child action blocks; surviving blocks are instructed to remove child blocks they have
 void removeUnviewableBlocks(Set<String> unviewableBlocks)
          Goes through all child fields; removes any fields which match unviewable blocks or otherwise, has the field remove unviewable blocks
 void setEditable()
          Sets any renderable element within this table joining block to be editable
 void setEditableBlocks(Set<String> editableBlocks)
          Instructs the element to make any child readOnlyizable blocks named within the given Set to read only
 void setFields(List<AccountingLineViewField> fields)
          Sets the fields attribute value.
 boolean shouldStretchToFillLine()
          This element should be stretched
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AccountingLineViewColumns

public AccountingLineViewColumns(AccountingLineViewColumnsDefinition definition,
                                 List<AccountingLineViewField> fields)
Constructs a AccountingLineViewColumns

Parameters:
definition - the data dictionary validation of this columns layout element
fields - the fields to render within this columns layout element
Method Detail

getName

public String getName()
Returns the name of this element

Specified by:
getName in interface ElementNamable
Returns:
the names of this table joining element
See Also:
ElementNamable.getName()

getRequestedRowCount

public int getRequestedRowCount()
Description copied from interface: TableJoining
The minimum number of rows this element needs if it is going to join a table

Specified by:
getRequestedRowCount in interface TableJoining
Returns:
the minimum number of rows
See Also:
TableJoining.getRequestedRowCount()

shouldStretchToFillLine

public boolean shouldStretchToFillLine()
This element should be stretched

Specified by:
shouldStretchToFillLine in interface AccountingLineViewLineFillingElement
Returns:
true if the line filling element should stretch its cell to fill the line; if false (or if the line contains more than a single cell), the line will be padded out with an empty cell
See Also:
org.kuali.kfs.sys.document.web.AccountingLineViewLineFillingElement#stretchToFillLine()

joinRow

public void joinRow(AccountingLineTableRow headerLabelRow,
                    AccountingLineTableRow row)
Joins the header row with a line filling cell, which includes within it an inner table that shows all the child fields

Specified by:
joinRow in interface TableJoining
Parameters:
headerLabelRow - the header row which can be joined
row - the row which can be joined
See Also:
TableJoining.joinRow(org.kuali.kfs.sys.document.web.AccountingLineTableRow, org.kuali.kfs.sys.document.web.AccountingLineTableRow)

createRowsForFields

protected List<AccountingLineTableRow> createRowsForFields()
Creates rows for the inner tables for each field inside this columsn definition

Returns:
a List of created AccountingLineTableRows

createHeaderCellForField

protected AccountingLineTableCell createHeaderCellForField(AccountingLineViewField field)
Creates a header cell for for the given field

Parameters:
field - the field to create a header cell for
Returns:
a header cell

createCellForField

protected AccountingLineTableCell createCellForField(AccountingLineViewField field)
Creates the "field" cell for the given field

Parameters:
field - the field to create a cell for
Returns:
the cell withe field in it

createPaddingCell

protected AccountingLineTableCell createPaddingCell()
Creates an empty cell to pad out the place typically held for a cell

Returns:
an empty table cell that spans two columns

joinTable

public void joinTable(List<AccountingLineTableRow> rows)
An exception state; line filling elements can only join tables through lines

Specified by:
joinTable in interface TableJoining
Parameters:
rows - the rows to join
See Also:
TableJoining.joinTable(java.util.List)

performFieldTransformations

public void performFieldTransformations(List<AccountingLineFieldRenderingTransformation> fieldTransformations,
                                        AccountingLine accountingLine,
                                        Map unconvertedValues)
Has fields perform the transformations

Specified by:
performFieldTransformations in interface TableJoining
accountingLine - the accounting line which is being rendering during the transformation
unconvertedValues - any unconverted values from the form
See Also:
org.kuali.kfs.sys.document.web.TableJoining#performFieldTransformations(java.util.List, org.kuali.kfs.sys.businessobject.AccountingLine, java.util.Map, java.util.Map)

removeAllActionBlocks

public void removeAllActionBlocks()
Removes any child action blocks; surviving blocks are instructed to remove child blocks they have

Specified by:
removeAllActionBlocks in interface TableJoining
See Also:
TableJoining.removeAllActionBlocks()

removeUnviewableBlocks

public void removeUnviewableBlocks(Set<String> unviewableBlocks)
Goes through all child fields; removes any fields which match unviewable blocks or otherwise, has the field remove unviewable blocks

Specified by:
removeUnviewableBlocks in interface TableJoining
Parameters:
unviewableBlocks - a Set of the names of blocks that should not be rendered
See Also:
TableJoining.removeUnviewableBlocks(java.util.Set)

readOnlyizeReadOnlyBlocks

public void readOnlyizeReadOnlyBlocks(Set<String> readOnlyBlocks)
Has each field readOnlyize

Specified by:
readOnlyizeReadOnlyBlocks in interface TableJoining
Parameters:
readOnlyBlocks - the names of blocks to make read only
See Also:
TableJoining.readOnlyizeReadOnlyBlocks(java.util.Set)

getFields

public List<AccountingLineViewField> getFields()
Gets the fields attribute.

Returns:
Returns the fields.

setFields

public void setFields(List<AccountingLineViewField> fields)
Sets the fields attribute value.

Parameters:
fields - The fields to set.

isReadOnly

public boolean isReadOnly()
Description copied from interface: ReadOnlyable
Determines whether is element is entirely read only or not

Specified by:
isReadOnly in interface ReadOnlyable
Returns:
true if the entire element is read only; false otherwise
See Also:
ReadOnlyable.isReadOnly()

readOnlyize

public void readOnlyize()
Description copied from interface: ReadOnlyable
Sets any renderable element within this table joining block to be read only

Specified by:
readOnlyize in interface ReadOnlyable
See Also:
ReadOnlyable.readOnlyize()

getDisplayingFieldWidth

public int getDisplayingFieldWidth()
Always returns 1; this will build an inner table in one cell

Specified by:
getDisplayingFieldWidth in interface AccountingLineViewLineFillingElement
Returns:
the number of displayed table cells this line expects to render as
See Also:
AccountingLineViewLineFillingElement.getDisplayingFieldWidth()

setEditableBlocks

public void setEditableBlocks(Set<String> editableBlocks)
Description copied from interface: TableJoining
Instructs the element to make any child readOnlyizable blocks named within the given Set to read only

Specified by:
setEditableBlocks in interface TableJoining
See Also:
TableJoining.setEditableBlocks(java.util.Set)

setEditable

public void setEditable()
Description copied from interface: ReadOnlyable
Sets any renderable element within this table joining block to be editable

Specified by:
setEditable in interface ReadOnlyable
See Also:
ReadOnlyable.setEditable()


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