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

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

public class HideShowLayoutElement
extends Object
implements AccountingLineViewLineFillingElement

The layout element for a hide/show wrapper of other elements


Constructor Summary
HideShowLayoutElement()
           
 
Method Summary
 void addLine(AccountingLineViewLineFillingElement line)
          Adds a single line to this element's list of lines
protected  List<AccountingLineTableRow> createBlankRows(int cellCount)
          Creates empty rows to populate the content of the hide/show block
protected  HideShowBlock createHideShowBlock(int headerRowCount)
          Creates the hide/show block
 AccountingLineViewHideShowLinesDefinition getDefinition()
          Gets the definition attribute.
 int getDisplayingFieldWidth()
          Always returns 1; this will appear in one table cell
 List<AccountingLineViewLineFillingElement> getLines()
          Gets the lines attribute.
 String getName()
          Returns the name of the child element - if that gets removed, then we need to be removed as well
 int getRequestedRowCount()
          All hide/show elements fit into one row
protected  int getRowsRequested()
          Returns the total number of rows requested by each child line
protected  void haveLinesJoinRows(List<AccountingLineTableRow> rows, int headerRowCount)
          Causes child lines to join the given set of rows
 boolean isReadOnly()
          Checks that all child lines are read only; if none are, then this must be read only too
 void joinRow(AccountingLineTableRow headerLabelRow, AccountingLineTableRow row)
          Joins the header label row with a cell that colspans the width of the row and that spans 2
 void joinTable(List<AccountingLineTableRow> rows)
          Requests that this layout element property join a number of rows which will make up a table
 void performFieldTransformations(List<AccountingLineFieldRenderingTransformation> fieldTransformations, AccountingLine accountingLine, Map unconvertedValues)
          Has the inner content perform any field transformations
 void readOnlyize()
          Read-onlyizes child lines
 void readOnlyizeReadOnlyBlocks(Set<String> readOnlyBlocks)
          Has the inner content read onlyize any blocks it needs to
 void removeAllActionBlocks()
          Shuffles the responsibility off to the inner content
 void removeUnviewableBlocks(Set<String> unviewableBlocks)
          Passes the unviewable blocks off the inner content
 void setDefinition(AccountingLineViewHideShowLinesDefinition definition)
          Sets the definition attribute value.
 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 setLines(List<AccountingLineViewLineFillingElement> lines)
          Sets the lines attribute value.
 boolean shouldStretchToFillLine()
          This layout element should be stretched
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HideShowLayoutElement

public HideShowLayoutElement()
Method Detail

getName

public String getName()
Returns the name of the child element - if that gets removed, then we need to be removed as well

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

getRequestedRowCount

public int getRequestedRowCount()
All hide/show elements fit into one row

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

joinRow

public void joinRow(AccountingLineTableRow headerLabelRow,
                    AccountingLineTableRow row)
Joins the header label row with a cell that colspans the width of the row and that spans 2

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)

shouldStretchToFillLine

public boolean shouldStretchToFillLine()
This layout 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()

joinTable

public void joinTable(List<AccountingLineTableRow> rows)
Description copied from interface: TableJoining
Requests that this layout element property join a number of rows which will make up a table

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

createHideShowBlock

protected HideShowBlock createHideShowBlock(int headerRowCount)
Creates the hide/show block

Parameters:
headerRowCount - the number of header rows
Returns:
the hide show block

getRowsRequested

protected int getRowsRequested()
Returns the total number of rows requested by each child line

Returns:
the total number of rows requested

createBlankRows

protected List<AccountingLineTableRow> createBlankRows(int cellCount)
Creates empty rows to populate the content of the hide/show block

Parameters:
cellCount - the number of rows which will be returned
Returns:
a List of empty rows

haveLinesJoinRows

protected void haveLinesJoinRows(List<AccountingLineTableRow> rows,
                                 int headerRowCount)
Causes child lines to join the given set of rows

Parameters:
rows - the List of rows which child lines can join
headerRowCount - the number of header rows

performFieldTransformations

public void performFieldTransformations(List<AccountingLineFieldRenderingTransformation> fieldTransformations,
                                        AccountingLine accountingLine,
                                        Map unconvertedValues)
Has the inner content perform any field 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)

readOnlyizeReadOnlyBlocks

public void readOnlyizeReadOnlyBlocks(Set<String> readOnlyBlocks)
Has the inner content read onlyize any blocks it needs to

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

removeAllActionBlocks

public void removeAllActionBlocks()
Shuffles the responsibility off to the inner content

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

removeUnviewableBlocks

public void removeUnviewableBlocks(Set<String> unviewableBlocks)
Passes the unviewable blocks off the inner content

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)

getLines

public List<AccountingLineViewLineFillingElement> getLines()
Gets the lines attribute.

Returns:
Returns the lines.

setLines

public void setLines(List<AccountingLineViewLineFillingElement> lines)
Sets the lines attribute value.

Parameters:
lines - The lines to set.

addLine

public void addLine(AccountingLineViewLineFillingElement line)
Adds a single line to this element's list of lines

Parameters:
line - the line to add

getDefinition

public AccountingLineViewHideShowLinesDefinition getDefinition()
Gets the definition attribute.

Returns:
Returns the definition.

setDefinition

public void setDefinition(AccountingLineViewHideShowLinesDefinition definition)
Sets the definition attribute value.

Parameters:
definition - The definition to set.

isReadOnly

public boolean isReadOnly()
Checks that all child lines are read only; if none are, then this must be read only too

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()
Read-onlyizes child lines

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

getDisplayingFieldWidth

public int getDisplayingFieldWidth()
Always returns 1; this will appear in one table 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.