org.kuali.kfs.sys.document.web.renderers
Class ReadOnlyRenderer

java.lang.Object
  extended by org.kuali.kfs.sys.document.web.renderers.FieldRendererBase
      extended by org.kuali.kfs.sys.document.web.renderers.ReadOnlyRenderer
All Implemented Interfaces:
FieldRenderer, Renderer
Direct Known Subclasses:
DynamicReadOnlyRender

public class ReadOnlyRenderer
extends FieldRendererBase

Renderer which displays a read only field


Constructor Summary
ReadOnlyRenderer()
           
 
Method Summary
protected  String buildBeginInquiryLink()
          Builds the opening anchor tag to make the displayed read only value open up an inquiry screen
protected  String buildBeginSpan()
          Generates the HTML for the opening span tag to wrap the displayed value
protected  String buildEndInquiryLink()
          Builds the closing anchor tag for the inquiry link
protected  String buildEndSpan()
          Generates the HTML for the closing span tag to wrap the displayed value
protected  String buildNonBreakingSpace()
           
 void clear()
          Clears the persisting tag.
 void closeNoWrapSpan(javax.servlet.jsp.PageContext pageContext, javax.servlet.jsp.tagext.Tag parentTag)
          Renders the closing of a no wrap span
protected  String discoverRenderValue()
          An algorithm to discover the actual read only value to render.
protected  String getValueForDropDown()
          Dropdowns are typically fields with codes, which may be close to meaningless, with more explanative labels.
protected  boolean isInquirableValue(String propertyValue)
          Determines if the given property value is worthy of having an inquiry for it
 void openNoWrapSpan(javax.servlet.jsp.PageContext pageContext, javax.servlet.jsp.tagext.Tag parentTag)
          Renders the opening of a no-wrap span
 void render(javax.servlet.jsp.PageContext pageContext, javax.servlet.jsp.tagext.Tag parentTag)
          Asks this renderer to render
 boolean renderQuickfinder()
          Nope, no quick finder here
 void setShouldRenderInquiry(boolean shouldRenderInquiry)
          Sets the shouldRenderInquiry attribute value.
protected  boolean shouldRenderInquiryLink()
          Determines if this read only field should attempt to display the inquiry link around the rendered value
 
Methods inherited from class org.kuali.kfs.sys.document.web.renderers.FieldRendererBase
buildOnBlur, getAccessibleTitle, getDynamicNameLabel, getErrorIconImageTag, getField, getFieldName, getQuickfinderTabIndex, isShowError, overrideOnBlur, renderErrorIcon, renderQuickFinderIfNecessary, setAccessibleTitle, setArbitrarilyHighTabIndex, setDynamicNameLabel, setField, setShowError
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReadOnlyRenderer

public ReadOnlyRenderer()
Method Detail

render

public void render(javax.servlet.jsp.PageContext pageContext,
                   javax.servlet.jsp.tagext.Tag parentTag)
            throws javax.servlet.jsp.JspException
Description copied from interface: Renderer
Asks this renderer to render

Parameters:
pageContext - the JSP page context to render to
parentTag - the tag that is the "parent" of this rendering
Throws:
javax.servlet.jsp.JspException
See Also:
Renderer.render(javax.servlet.jsp.PageContext, javax.servlet.jsp.tagext.Tag)

clear

public void clear()
Clears the persisting tag.

Specified by:
clear in interface Renderer
Overrides:
clear in class FieldRendererBase
See Also:
FieldRendererBase.clear()

buildBeginSpan

protected String buildBeginSpan()
Generates the HTML for the opening span tag to wrap the displayed value

Parameters:
propertyPrefix - the property path from the form the business object being rendered
Returns:
the HTML for the opening span

buildEndSpan

protected String buildEndSpan()
Generates the HTML for the closing span tag to wrap the displayed value

Returns:
the HTML for the closing span

buildBeginInquiryLink

protected String buildBeginInquiryLink()
Builds the opening anchor tag to make the displayed read only value open up an inquiry screen

Returns:
the HTML for the opening inquiry anchor tag

buildEndInquiryLink

protected String buildEndInquiryLink()
Builds the closing anchor tag for the inquiry link

Returns:
the HTML for the closing inquiry anchor tag

shouldRenderInquiryLink

protected boolean shouldRenderInquiryLink()
Determines if this read only field should attempt to display the inquiry link around the rendered value

Returns:
true if the inquiry link should be rendered, false otherwise

isInquirableValue

protected boolean isInquirableValue(String propertyValue)
Determines if the given property value is worthy of having an inquiry for it

Parameters:
propertyValue - the value of the property to potentially render an inquiry for
Returns:
true if the value is inquirable; false otherwise

setShouldRenderInquiry

public void setShouldRenderInquiry(boolean shouldRenderInquiry)
Sets the shouldRenderInquiry attribute value.

Parameters:
shouldRenderInquiry - The shouldRenderInquiry to set.

getValueForDropDown

protected String getValueForDropDown()
Dropdowns are typically fields with codes, which may be close to meaningless, with more explanative labels. Therefore, fields which are drop downs should display the label instead

Returns:
the label for the chosen key on the field if possible; otherwise, an empty String

discoverRenderValue

protected String discoverRenderValue()
An algorithm to discover the actual read only value to render. If this is a drop down, it finds the renderable value for the drop down; if the value is unavailable, it searches for the property in unconverted values

Returns:
the value to display

buildNonBreakingSpace

protected String buildNonBreakingSpace()
Returns:
the HTML for a non-breaking space, so the box isn't all empty

renderQuickfinder

public boolean renderQuickfinder()
Nope, no quick finder here

Returns:
true if a quick finder should be rendered, false otherwise
See Also:
FieldRenderer.renderQuickfinder()

closeNoWrapSpan

public void closeNoWrapSpan(javax.servlet.jsp.PageContext pageContext,
                            javax.servlet.jsp.tagext.Tag parentTag)
                     throws javax.servlet.jsp.JspException
Description copied from interface: FieldRenderer
Renders the closing of a no wrap span

Specified by:
closeNoWrapSpan in interface FieldRenderer
Overrides:
closeNoWrapSpan in class FieldRendererBase
Parameters:
pageContext - the page contex to render to
parentTag - the tag requesting all of this rendering
Throws:
javax.servlet.jsp.JspException - thrown if something goes wrong in rendering
See Also:
FieldRendererBase.closeNoWrapSpan(javax.servlet.jsp.PageContext, javax.servlet.jsp.tagext.Tag)

openNoWrapSpan

public void openNoWrapSpan(javax.servlet.jsp.PageContext pageContext,
                           javax.servlet.jsp.tagext.Tag parentTag)
                    throws javax.servlet.jsp.JspException
Description copied from interface: FieldRenderer
Renders the opening of a no-wrap span

Specified by:
openNoWrapSpan in interface FieldRenderer
Overrides:
openNoWrapSpan in class FieldRendererBase
Parameters:
pageContext - the page contex to render to
parentTag - the tag requesting all of this rendering
Throws:
javax.servlet.jsp.JspException - thrown if something goes wrong in rendering
See Also:
FieldRendererBase.openNoWrapSpan(javax.servlet.jsp.PageContext, javax.servlet.jsp.tagext.Tag)


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