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

java.lang.Object
  extended by org.kuali.kfs.sys.document.web.RenderableAccountingLineContainer
All Implemented Interfaces:
AccountingLineRenderingContext, RenderableElement

public class RenderableAccountingLineContainer
extends Object
implements RenderableElement, AccountingLineRenderingContext

A container which holds a single accounting line and the elements which will render it


Constructor Summary
RenderableAccountingLineContainer(KualiAccountingDocumentFormBase form, AccountingLine accountingLine, String accountingLineProperty, List<AccountingLineTableRow> rows, Integer lineCount, String groupLabel, List errors, AccountingLineAuthorizer accountingLineAuthorizer, boolean editableLine)
          Constructs a RenderableAccountingLineContainer
 
Method Summary
 boolean allowDelete()
          Determines whether the line within this rendering context can be deleted.
 void appendFields(List<org.kuali.rice.kns.web.ui.Field> fields)
          Appends all fields from rows that this contains
 boolean fieldsCanRenderDynamicLabels()
          Tells callers if dynamic field labels should even be rendered
 boolean fieldsShouldRenderHelp()
          Tells callers if fields should render help or not
 AccountingDocument getAccountingDocument()
           
 AccountingLine getAccountingLine()
          Gets the accountingLine attribute.
 String getAccountingLineContainingObjectPropertyName()
           
 String getAccountingLineProperty()
          Gets the accountingLineProperty attribute.
 String getAccountingLinePropertyPath()
           
 List<AccountingLineViewAction> getActionsForLine()
          Gets the actions attribute.
 int getCellCount()
           
 Integer getCurrentLineCount()
          If this is a new line, returns null; if it is a line in a collection, returns the line number within that collection
 List getErrors()
          Gets the errors attribute.
 List<String> getFieldNamesForAccountingLine()
          Returns all the field names for the given accounting line, prefixed by the accounting line property path
 List<org.kuali.rice.kns.web.ui.Field> getFieldsForAccountingLine()
          Returns all of the field names within the accounting line to render
 KualiAccountingDocumentFormBase getForm()
           
 String getGroupLabel()
           
 List<AccountingLineTableRow> getRows()
          Gets the rows attribute.
 String getTabState(String tabKey)
          Returns the tab state for the given tab key on the current form
 Map getUnconvertedValues()
          Returns the unconvertedValues for the current form
 void incrementTabIndex()
          Increments the tab index on the form this rendering is associated with
 boolean isActionBlock()
          While holding an action block, this is not an action block
 boolean isEditableLine()
          Gets the editableLine attribute.
 boolean isEmpty()
          This is never empty
 boolean isFieldModifyable(String fieldName)
          Determines whether a field is modifyable or not
 boolean isHidden()
          This is not hidden
 boolean isNewLine()
          Gets the newLine attribute.
 void makeDeletable()
          Makes the line within this accounting line context deletable
protected  void padOutRow(int cellCount, AccountingLineTableRow row)
          Adds empty cells to a table row
 void populateValuesForFields()
          Forces the population of values for all fields used to render the accounting line
 void populateWithTabIndexIfRequested(int reallyHighIndex)
          Allows the arbitrarily high tab index to be set for controls
 void renderElement(javax.servlet.jsp.PageContext pageContext, javax.servlet.jsp.tagext.Tag parentTag, AccountingLineRenderingContext renderingContext)
          Renders all the rows
 void setEditableLine(boolean editableLine)
          Sets the editableLine attribute value.
protected  void setShouldShowSecure(org.kuali.rice.kns.web.ui.Field field, org.kuali.rice.kns.datadictionary.BusinessObjectEntry boDDEntry)
          Sets the masked value equal to the value if the current user can see the unmasked value for a secure field
protected  void setUnconvertedValueIfNecessary(org.kuali.rice.kns.web.ui.Field field)
          Sees if the given field has an unconverted value living in the unconverted value map and if so, changes the value to that
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RenderableAccountingLineContainer

public RenderableAccountingLineContainer(KualiAccountingDocumentFormBase form,
                                         AccountingLine accountingLine,
                                         String accountingLineProperty,
                                         List<AccountingLineTableRow> rows,
                                         Integer lineCount,
                                         String groupLabel,
                                         List errors,
                                         AccountingLineAuthorizer accountingLineAuthorizer,
                                         boolean editableLine)
Constructs a RenderableAccountingLineContainer

Parameters:
form - the form being rendered
accountingLine - the accounting line this container will render
accountingLineProperty - the property to that accounting line
rows - the rows to render
newLine - whether this is a new accounting line or not
groupLabel - the label for the group this accounting line is being rendered part of
errors - the set of errors currently on the document
accountingLineAuthorizer - the accounting line authorizer for the document
editableLine - whether this line, as a whole _line_ is editable
Method Detail

getAccountingLine

public AccountingLine getAccountingLine()
Gets the accountingLine attribute.

Specified by:
getAccountingLine in interface AccountingLineRenderingContext
Returns:
Returns the accountingLine.

getAccountingLineProperty

public String getAccountingLineProperty()
Gets the accountingLineProperty attribute.

Returns:
Returns the accountingLineProperty.

getActionsForLine

public List<AccountingLineViewAction> getActionsForLine()
Gets the actions attribute.

Specified by:
getActionsForLine in interface AccountingLineRenderingContext
Returns:
Returns the actions.

isNewLine

public boolean isNewLine()
Gets the newLine attribute.

Specified by:
isNewLine in interface AccountingLineRenderingContext
Returns:
Returns the newLine.

getCurrentLineCount

public Integer getCurrentLineCount()
Description copied from interface: AccountingLineRenderingContext
If this is a new line, returns null; if it is a line in a collection, returns the line number within that collection

Specified by:
getCurrentLineCount in interface AccountingLineRenderingContext
Returns:
the current line count
See Also:
AccountingLineRenderingContext.getCurrentLineCount()

getRows

public List<AccountingLineTableRow> getRows()
Gets the rows attribute.

Returns:
Returns the rows.

getCellCount

public int getCellCount()
Returns:
the number of cells this accounting line container will render

padOutRow

protected void padOutRow(int cellCount,
                         AccountingLineTableRow row)
Adds empty cells to a table row

Parameters:
cellCount - the number of cells we should be rendering
row - the row to pad out

isActionBlock

public boolean isActionBlock()
While holding an action block, this is not an action block

Specified by:
isActionBlock in interface RenderableElement
Returns:
true if this is an action block, false otherwise
See Also:
RenderableElement.isActionBlock()

isEmpty

public boolean isEmpty()
This is never empty

Specified by:
isEmpty in interface RenderableElement
Returns:
true if it should not be rendered, false otherwise
See Also:
RenderableElement.isEmpty()

isHidden

public boolean isHidden()
This is not hidden

Specified by:
isHidden in interface RenderableElement
Returns:
true if hidden, false otherwise
See Also:
RenderableElement.isHidden()

renderElement

public void renderElement(javax.servlet.jsp.PageContext pageContext,
                          javax.servlet.jsp.tagext.Tag parentTag,
                          AccountingLineRenderingContext renderingContext)
                   throws javax.servlet.jsp.JspException
Renders all the rows

Specified by:
renderElement in interface RenderableElement
Parameters:
pageContext - the context to render to
parentTag - the parent tag that is requesting this rendering
renderingContext - the context about the accounting line that this element would end up rendering
Throws:
javax.servlet.jsp.JspException
See Also:
RenderableElement.renderElement(javax.servlet.jsp.PageContext, javax.servlet.jsp.tagext.Tag, org.kuali.kfs.sys.document.web.AccountingLineRenderingContext)

getAccountingLinePropertyPath

public String getAccountingLinePropertyPath()
Specified by:
getAccountingLinePropertyPath in interface AccountingLineRenderingContext
Returns:
the property path from the form to the accounting line returned by the getAccountingLine() method
See Also:
AccountingLineRenderingContext.getAccountingLinePropertyPath()

appendFields

public void appendFields(List<org.kuali.rice.kns.web.ui.Field> fields)
Appends all fields from rows that this contains

Specified by:
appendFields in interface RenderableElement
See Also:
org.kuali.kfs.sys.document.web.RenderableElement#appendFieldNames(java.util.List)

getFieldsForAccountingLine

public List<org.kuali.rice.kns.web.ui.Field> getFieldsForAccountingLine()
Returns all of the field names within the accounting line to render

Returns:
a List of field names with the accounting line property prefixed

getFieldNamesForAccountingLine

public List<String> getFieldNamesForAccountingLine()
Description copied from interface: AccountingLineRenderingContext
Returns all the field names for the given accounting line, prefixed by the accounting line property path

Specified by:
getFieldNamesForAccountingLine in interface AccountingLineRenderingContext
Returns:
a list of properly prefixed field names
See Also:
AccountingLineRenderingContext.getFieldNamesForAccountingLine()

populateWithTabIndexIfRequested

public void populateWithTabIndexIfRequested(int reallyHighIndex)
Description copied from interface: RenderableElement
Allows the arbitrarily high tab index to be set for controls

Specified by:
populateWithTabIndexIfRequested in interface RenderableElement
Parameters:
reallyHighIndex - a really high index for elements who should not be tabbed to
See Also:
org.kuali.kfs.sys.document.web.RenderableElement#populateWithTabIndexIfRequested(int[], int)

getUnconvertedValues

public Map getUnconvertedValues()
Returns the unconvertedValues for the current form

Specified by:
getUnconvertedValues in interface AccountingLineRenderingContext
Returns:
the Map of unconverted values
See Also:
AccountingLineRenderingContext.getUnconvertedValues()

populateValuesForFields

public void populateValuesForFields()
Description copied from interface: AccountingLineRenderingContext
Forces the population of values for all fields used to render the accounting line

Specified by:
populateValuesForFields in interface AccountingLineRenderingContext
See Also:
AccountingLineRenderingContext.populateValuesForFields()

setUnconvertedValueIfNecessary

protected void setUnconvertedValueIfNecessary(org.kuali.rice.kns.web.ui.Field field)
Sees if the given field has an unconverted value living in the unconverted value map and if so, changes the value to that

Parameters:
field - the field to possibly set an unconverted value on

setShouldShowSecure

protected void setShouldShowSecure(org.kuali.rice.kns.web.ui.Field field,
                                   org.kuali.rice.kns.datadictionary.BusinessObjectEntry boDDEntry)
Sets the masked value equal to the value if the current user can see the unmasked value for a secure field

Parameters:
field - the field to possible change the value for
boDDEntry - the data dictionary entry for the accounting line

getAccountingDocument

public AccountingDocument getAccountingDocument()
Specified by:
getAccountingDocument in interface AccountingLineRenderingContext
Returns:
the accounting document that this line to render is part of (or will be, once it is successfully added)
See Also:
AccountingLineRenderingContext.getAccountingDocument()

fieldsCanRenderDynamicLabels

public boolean fieldsCanRenderDynamicLabels()
Description copied from interface: AccountingLineRenderingContext
Tells callers if dynamic field labels should even be rendered

Specified by:
fieldsCanRenderDynamicLabels in interface AccountingLineRenderingContext
Returns:
true if dynamic field labels can be labeled, false if they should not be labeled.
See Also:
AccountingLineRenderingContext.fieldsCanRenderDynamicLabels()

fieldsShouldRenderHelp

public boolean fieldsShouldRenderHelp()
Description copied from interface: AccountingLineRenderingContext
Tells callers if fields should render help or not

Specified by:
fieldsShouldRenderHelp in interface AccountingLineRenderingContext
Returns:
true if fields should render help, false otherwise
See Also:
AccountingLineRenderingContext.fieldsShouldRenderHelp()

getTabState

public String getTabState(String tabKey)
Description copied from interface: AccountingLineRenderingContext
Returns the tab state for the given tab key on the current form

Specified by:
getTabState in interface AccountingLineRenderingContext
Parameters:
tabKey - the tab key to get the state of
Returns:
the state (either "OPEN" or "CLOSED")
See Also:
AccountingLineRenderingContext.getTabState(java.lang.String)

incrementTabIndex

public void incrementTabIndex()
Description copied from interface: AccountingLineRenderingContext
Increments the tab index on the form this rendering is associated with

Specified by:
incrementTabIndex in interface AccountingLineRenderingContext
See Also:
AccountingLineRenderingContext.incrementTabIndex()

getGroupLabel

public String getGroupLabel()
Specified by:
getGroupLabel in interface AccountingLineRenderingContext
Returns:
the label of the group this accounting line is part of
See Also:
AccountingLineRenderingContext.getGroupLabel()

getErrors

public List getErrors()
Gets the errors attribute.

Specified by:
getErrors in interface AccountingLineRenderingContext
Returns:
Returns the errors.

getForm

public KualiAccountingDocumentFormBase getForm()
Specified by:
getForm in interface AccountingLineRenderingContext
Returns:
the form that the rendered accounting line will be associated with
See Also:
AccountingLineRenderingContext.getForm()

getAccountingLineContainingObjectPropertyName

public String getAccountingLineContainingObjectPropertyName()
Specified by:
getAccountingLineContainingObjectPropertyName in interface AccountingLineRenderingContext
Returns:
the property name of the object that contains the accounting lines
See Also:
AccountingLineRenderingContext.getAccountingLineContainingObjectPropertyName()

isFieldModifyable

public boolean isFieldModifyable(String fieldName)
Description copied from interface: AccountingLineRenderingContext
Determines whether a field is modifyable or not

Specified by:
isFieldModifyable in interface AccountingLineRenderingContext
Parameters:
fieldName - the simple name (that is, the name does not include the collection property) of the field
Returns:
true if the field can be modified, false if the field can only be read
See Also:
org.kuali.kfs.sys.document.web.AccountingLineRenderingContext#isFieldModifyable(org.kuali.kfs.sys.document.web.AccountingLineViewField)

isEditableLine

public boolean isEditableLine()
Gets the editableLine attribute.

Specified by:
isEditableLine in interface AccountingLineRenderingContext
Returns:
Returns the editableLine.

setEditableLine

public void setEditableLine(boolean editableLine)
Sets the editableLine attribute value.

Parameters:
editableLine - The editableLine to set.

allowDelete

public boolean allowDelete()
Determines whether the line within this rendering context can be deleted.

Specified by:
allowDelete in interface AccountingLineRenderingContext
Returns:
true if it should be allowed to be deleted, false otherwise
See Also:
AccountingLineRenderingContext.allowDelete()

makeDeletable

public void makeDeletable()
Makes the line within this accounting line context deletable

Specified by:
makeDeletable in interface AccountingLineRenderingContext


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