jeanmonod
21 Jan 2009, 4:28 AM
Hi all,
I spend a lot of time debugging to understand why when I was calling getParent on my TreeModel object I was getting a null pointer exception.
But then I discover this note in the JavaDoc of the TreeStore:
"The parent child relationshiops are handled internally by the store. It is important to note that the store does not use the the parent and children of any TreeModel instances added to the store."
OK, but why? What does it means? So following that I should be able to use a DataModel instead of a TreeModel. Is that right?
In if it's right, considering that the TreeStore is handelling relations internally, is there any justification to use a TreeModel for displaying a Tree?
Now, my problem is that if I give the herarchical management to the TreeStore, how can I retrieved the parent of one of my element?
If someone have a good understanding of the Class structure for building a Tree, thanks to help on this subject.
Cheers,
David
I spend a lot of time debugging to understand why when I was calling getParent on my TreeModel object I was getting a null pointer exception.
But then I discover this note in the JavaDoc of the TreeStore:
"The parent child relationshiops are handled internally by the store. It is important to note that the store does not use the the parent and children of any TreeModel instances added to the store."
OK, but why? What does it means? So following that I should be able to use a DataModel instead of a TreeModel. Is that right?
In if it's right, considering that the TreeStore is handelling relations internally, is there any justification to use a TreeModel for displaying a Tree?
Now, my problem is that if I give the herarchical management to the TreeStore, how can I retrieved the parent of one of my element?
If someone have a good understanding of the Class structure for building a Tree, thanks to help on this subject.
Cheers,
David