Since there is a check below the loop for "cellRenderer == null" we
should just skip the whole loop involving valueClass if the cellData is
null (because then the valueClass will also be null). Something like
this:
TableView.CellRenderer cellRenderer = null;
if (cellData != null) {
Class<?> valueClass = cellData.getClass();
while (cellRenderer == null
&& valueClass != Object.class) {
cellRenderer = cellRenderers.get(valueClass);
if (cellRenderer == null) {
valueClass = valueClass.getSuperclass();
}
}
}
if (cellRenderer == null) {
cellRenderer = defaultRenderer;
}
~Roger Whitcomb
-----Original Message-----
From: Sandro Martini [mailto:[email protected]]
Sent: Wednesday, January 02, 2013 11:20 AM
To: [email protected]
Subject: Re: ScrollPane usage on modified RowEditor
Hi Brendan,
> Thanks and happy New Year!
thank you very much, and of course the same to you ...
After put your sources in a test application, I get the following
(inside eclipse-3.7.2 updated to 4.2.1, and latest JDK 6 Uodate 38 in
Windows 7 at 64 bits) compile errors:
Description Resource Path Location Type
Cannot cast from Object to
int CellsTagTableView.java /_prove/src/hk line 581 Java
Problem
Cannot cast from Object to
int CellsTagTableView.java /_prove/src/hk line 598 Java
Problem
Cannot cast from Object to
int CellsTagTableView.java /_prove/src/hk line 588 Java
Problem
Cannot cast from Object to
int CellsTagTableView.java /_prove/src/hk line 604 Java
Problem
could give some problems ...
Anyway I have to continue to look at your sources ...
This is a sample of a small diff of my changes in your code:
// return (int) row.get(Header_RowIndex);
Object objIndex = row.get(Header_RowIndex);
Integer intIndex = new Integer(objIndex.toString());
return intIndex.intValue();
Ok, found the problem:
in the condition od the floating element open, valueClass is null, so
the IAE for the next find.
java.lang.IllegalArgumentException: key cannot be null.
at org.apache.pivot.collections.HashMap.get(HashMap.java:158)
at
org.apache.pivot.wtk.content.TableViewMultiCellRenderer.render(TableView
MultiCellRenderer.java:332)
I have to verify now if it's better to check for it not null (could be
enough), or if in that case if assign to it a default value ...
Roger, what do you think ?
Let's update.
Bye