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{
@Override
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();
setText(principal.getValue());
System.out.println("set text to "+getText());
} else
setText("--not specified--");
layout();
}
@Override
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" <[email protected]>
À: [email protected]
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 :-) .
Bye