com.docmosis.template.population.render
Class AlternatingTableRowRenderer
java.lang.Object
com.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.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
colour1
protected String colour1
colour2
protected String colour2
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 colourcolour2
- even row colour
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
Copyright © 2014 Docmosis Pty Ltd. All Rights Reserved.