0

I have code like this:

//(...)
JTableFixture myTreeTable = frame.table(matcher);

If I try to obtain JCellFixtures or values or contents, everything is null. I am only obtaining the number of rows or columns. JTable internally uses a CellRendererPanel which I guess I have to fetch. But how? JTable has no ContainerFixture to make .panel(). Is there any way to get the cell values in these circumstances? How it is usually done when there is a cell renderer panel?

This is the hierarchy for the FEST debugger:

gui.treetable.myTreeTable[name=null, rowCount=33, columnCount=2, enabled=true, visible=true, showing=true]
   javax.swing.CellRendererPane[,0,0,0x0,hidden]
Illidanek
  • 996
  • 1
  • 18
  • 32
Whimusical
  • 6,401
  • 11
  • 62
  • 105

1 Answers1

3

If you table has a custom cell renderer you can provide your your own cell reader. Check out Custom Cell Renderers article. It demonstrates how to extend BasicJTableCellReader and how to use the reader in JTableFixture.

tenorsax
  • 21,123
  • 9
  • 60
  • 107
  • 1
    Oops, I already found it but its exactly what I ended up doing!! For those who can have a similar need: I needed to cast inoming Component in valueAt for my custom BasicJTableCellReader to a JTree, but FEST does not tell the type, it says CellRendererPane. Then its only a matter of adding this cellreder to the table trough celReader(reader) method in JTableFixture. – Whimusical Jul 30 '12 at 19:38