Tree-table component

P

Patrick

Hello,

Is it possible to have a tree-table component with the tree spanning
over all columns? I mean, each branch level in a different column?
Something like this:

-A1 | | |
| -A2 | |
| | A3 |
| +B2 | |
| -C2 | |
| | B3 |
| | C3 |

My priority target is SWT, but I'd also like to know what exists in Swing.
Thanks in advance!
 
S

Stefan Rybacki

Patrick said:
Hello,

Is it possible to have a tree-table component with the tree spanning
over all columns? I mean, each branch level in a different column?
Something like this:

-A1 | | |
| -A2 | |
| | A3 |
| +B2 | |
| -C2 | |
| | B3 |
| | C3 |

My priority target is SWT, but I'd also like to know what exists in Swing.
Thanks in advance!

There is definitely something in SWT (TreeTable) but nothing comparable in
Swing. I'm aware though of an article series how to write a TreeTable in Swing
which dates way back to Java 1.3 times I think. And if I remember correct wasn't
the best way of implementing a TreeTable. But the guys from Netbeans created a
more sophisticated tree table component called Outline. You might want to have a
look at it.

Stefan
 
P

Patrick

Le 19/11/2008 11:23, Stefan Rybacki a écrit :
There is definitely something in SWT (TreeTable) but nothing comparable
in Swing. I'm aware though of an article series how to write a TreeTable
in Swing which dates way back to Java 1.3 times I think. And if I
remember correct wasn't the best way of implementing a TreeTable. But
the guys from Netbeans created a more sophisticated tree table component
called Outline. You might want to have a look at it.

Thanks, but this is not what I'm looking for.
SWT TreeTable, and Outline component, only have a tree limited to the
first column, followed by normal table columns, like this:

-A1 | 2 | 3 |
-A2 | 2 | 3 |
A3 | 2 | 3 |
+B2 | 2 | 3 |
-C2 | 2 | 3 |
B3 | 2 | 3 |
C3 | 2 | 3 |

But I want tree branches spanned over different columns, like this:

-A1 | | | 4 | 5 |
| -A2 | | 4 | 5 |
| | A3 | 4 | 5 |
| +B2 | | 4 | 5 |
| -C2 | | 4 | 5 |
| | B3 | 4 | 5 |
| | C3 | 4 | 5 |

Other suggestions?
 
B

Bent C Dalager

Thanks, but this is not what I'm looking for.
SWT TreeTable, and Outline component, only have a tree limited to the
first column, followed by normal table columns, like this:

-A1 | 2 | 3 |
-A2 | 2 | 3 |
A3 | 2 | 3 |
+B2 | 2 | 3 |
-C2 | 2 | 3 |
B3 | 2 | 3 |
C3 | 2 | 3 |

But I want tree branches spanned over different columns, like this:

-A1 | | | 4 | 5 |
| -A2 | | 4 | 5 |
| | A3 | 4 | 5 |
| +B2 | | 4 | 5 |
| -C2 | | 4 | 5 |
| | B3 | 4 | 5 |
| | C3 | 4 | 5 |

Other suggestions?

I think the primary difficulty with such a component is in defining
the behaviour when expanding one of the deepest shown nodes. That is,
if you have

-A1 | | | 4 | 5 |
| -A2 | | 4 | 5 |
| | +A3 | 4 | 5 |
| +B2 | | 4 | 5 |
| -C2 | | 4 | 5 |
| | B3 | 4 | 5 |
| | C3 | 4 | 5 |

and you expand A3, what should happen? Should a new column magically
appear or should there already have been an empty column there in
anticipation of the potential future expansion event?

As for Swing, once this behaviour has been defined your requirement
appears to be relatively easily adaptable from the existing
only-one-tree-column JTreeTable component. Basically all you need to
do is spread the cropped cell renderers and editors across multiple
columns rather than just the one.

Cheers,
Bent D
 
J

John B. Matthews

[...]
SWT TreeTable, and Outline component, only have a tree limited to the
first column, followed by normal table columns, like this:

-A1 | 2 | 3 |
-A2 | 2 | 3 |
A3 | 2 | 3 |
+B2 | 2 | 3 |
-C2 | 2 | 3 |
B3 | 2 | 3 |
C3 | 2 | 3 |

But I want tree branches spanned over different columns, like this:

-A1 | | | 4 | 5 |
| -A2 | | 4 | 5 |
| | A3 | 4 | 5 |
| +B2 | | 4 | 5 |
| -C2 | | 4 | 5 |
| | B3 | 4 | 5 |
| | C3 | 4 | 5 |

Other suggestions?

This article, cited in another thread, mentions indenting as a function
of depth:

<http://www.jroller.com/santhosh/entry/tree_inside_jcombobox>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top