pivot-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Roger and Beth Whitcomb <RogerandB...@rbwhitcomb.com>
Subject Re: Custom style in table view
Date Mon, 04 Jun 2012 03:43:42 GMT
You probably would want a custom cell renderer.  You can start with the 
Tutorial on custom TableViews here: 

What you would end up writing is a small class that subclasses 
TableViewCellRenderer or implements TableView.CellRenderer.  There are 
several predefined ones you could use as examples such as 
TableViewCheckboxCellRenderer or TableViewTextAreaCellRenderer.  The 
basic idea is that a renderer does what it takes to display its contents 
when asked.  It can be implemented using another Pivot control (such as 
a Label) that does the heavy lifting of doing the drawing and size 
calculations.  To do the coloring, you would just set styles on your 
Label depending on the value.

HTH.  Thanks for using Pivot and feel free to ask if you need more help.


On 6/3/12 6:17 PM, Joseph Paterson wrote:
> Hi,
> I'm building a TableView using apache-pivot that will have some cells 
> that will contain a currency value (or '-' if the value is null). For 
> visual feedback I'd like the text to appear in green if the value is 
> zero or positive, and in red if the value is negative. I'm not quite 
> sure where to start with this - any pointers?
> Many thanks,
> Joseph.

View raw message