pivot-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Delbecq <de...@meteo.be>
Subject Re: NullPointerException when using Label as CellRenderer
Date Tue, 20 Dec 2011 11:14:42 GMT
No, it doesn't solve the issue. 

I don't get NullPointerException anymore, but the renderer doesn't display anything. Once
again, calling layout() works around the problem. 

Here is my renderer. When layout() is commented, the column displays empty. 

public class PrincipalCellRenderer extends Label implements TableView.CellRenderer{ 

public void render(Object row, int rowIndex, int columnIndex, 
TableView tableView, String columnName, boolean selected, 
boolean highlighted, boolean disabled) { 
if (row !=null){ 
DavPrincipal principal = ((DavAce)row).getPrincipal(); 
System.out.println("set text to "+getText()); 
} else 
setText("--not specified--"); 


public String toString(Object row, String columnName) { 
if (row !=null){ 
DavPrincipal principal = ((DavAce)row).getPrincipal(); 
return principal.getValue(); 

return "--not specified--"; 


----- Mail original -----

De: "Sandro Martini" <sandro.martini@gmail.com> 
À: user@pivot.apache.org 
Envoyé: Lundi 19 Décembre 2011 15:32:44 
Objet: Re: NullPointerException when using Label as CellRenderer 

Email filters delete the attachment ... Just committed even the new 
test in trunk now (but under the tests subproject): 
table_view_test3.bxml, TableViewCellRendererCustom.java . 

Note that (as written is Java source) it transform the given string in 
uppercase ... just to make it doing something :-) . 


View raw message