Docmosis API 4.5.0

com.docmosis.template.population.render
Class AlternatingTableRowRenderer

java.lang.Object
  extended bycom.docmosis.template.population.render.AlternatingTableRowRenderer
All Implemented Interfaces:
FieldRenderer

public class AlternatingTableRowRenderer
extends Object
implements FieldRenderer

This class renders alternating rows of a table in the two colours specified at construction. Other classes can sub-class this class to add specific rendering controls in addition to alternating row colours. The render method ALWAYS returns a SimpleRenderedField so that subclasses may override it's behaviour

NOTE: It is typically much easier to alternate table row background colours directly in the template. See the template developer guide for more details.


Field Summary
protected  String colour1
           
protected  String colour2
           
 
Constructor Summary
AlternatingTableRowRenderer()
          Construct a new alternating row renderer that alternates white then light grey.
AlternatingTableRowRenderer(String colour1, String colour2)
          Construct a new renderer that alternates between the specified colours.
 
Method Summary
 RenderedField render(FieldDetails details, RenderedField renderedField)
          Make rendering adjustments for a field.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

colour1

protected String colour1

colour2

protected String colour2
Constructor Detail

AlternatingTableRowRenderer

public AlternatingTableRowRenderer()
Construct a new alternating row renderer that alternates white then light grey.


AlternatingTableRowRenderer

public AlternatingTableRowRenderer(String colour1,
                                   String colour2)
Construct a new renderer that alternates between the specified colours.

Parameters:
colour1 - odd row colour
colour2 - even row colour
Method Detail

render

public RenderedField render(FieldDetails details,
                            RenderedField renderedField)
Description copied from interface: FieldRenderer
Make rendering adjustments for a field. Adjustments are made by adjusting the given RenderedField and then returning it, or by creating a new RenderedField instance and returning it. If no adjustments are desired the given RenderedField should be returned unchanged. The FieldDetails object gives details about the field.

Specified by:
render in interface FieldRenderer
Parameters:
details - all the details about the field to be rendered.
Returns:
the given RenderedField or a new RenderedField

Docmosis API 4.5.0

Copyright © 2014 Docmosis Pty Ltd. All Rights Reserved.