Hi all,
I have been working on trying to get my model too behave
like a tree table. I have tried several different approaches but I must be
missing something or some point? Here’s what I’m seeing:
If I wrap my model objects in a Task wrapper as shown in the
example, I get a great table with all the data laid out as expected. This is
because each Task object contains a row of objects that match up with the
columns defined in the Factory class. The XViewer logic loops over the defined column
identifiers and sends the same wrapper object to my getColumnText in my label
provider with a different column identifier which queues me on what data to
request from the wrapper object. However, for each column defined, it also
sends the same wrapper object to my content provider methods, but the wrapper
has no relationship to my model? The column objects inside my wrapper do but
the interface only allows for one relationship to be passed out and besides,
the objects inside the wrapper are a tiny portion of the overall model?
If I redesign my input so that the relationships between the
objects can be understood by the tree viewer, such as an array of arrays or a linear
array with the root node being the first object in my list then I actually get
my model objects to my content provider code and can enforce the relationships
from there. However I get the same object sent to my label provider for the
number of columns defined (with a different column identifier of course) so I
get row data that is unidentified for all but one column? I get a node that I
can expand/collapse based on the definition set in my content provider but, of
course most of the data is garbled?
I’m I missing something here? I don’t see how to
separate the table from the tree if my content provider getChildren gets called
with the same object times the number of columns that exist. Anyone have an
example of XViewer behaving as a tree table? I’m probably just missing
the big picture here but I’ve walked through the code several times in
the debugger and it is not clear to me how to get the tree and table part to
work independently of each other?
Any help would be appreciated.
Thanks,
Mike