2

I think this question is quite common.

Recently I have got a requirement that I need to make a leveled or expandable table-like view. If you need an example, you can refer to Mac OS X's Activity Monitor: Leveled rows in a table view

At the same time I tried an example here which meets my requirement quite a little: SWT one http://www.java2s.com/Code/Java/SWT-JFace-Eclipse/SWTTreeWithMulticolumns.htm

But it has some problems: 1. It's using SWT's Tree class not JFace classes; 2. I think it needs a repeat implementation of some JFace viewer classes's functions such as sorting by clicking a column header, filter and so on.

While I was feeling desperate, I found that Eclipse itself has a perfect view, its "Problems" view: Problems view in Eclipse

So I think there must be a way to do it elegantly, for example extend JFace's TableViewer or TreeViewer class.

But I need help, since I've searched a lot in Google with no good result. :-(

flavio.donze
  • 7,432
  • 9
  • 58
  • 91
Dennis Wong
  • 189
  • 4
  • 11

3 Answers3

5

That's simply a TreeViewer. Note that you can add TreeViewerColumns to it.

Alexey Romanov
  • 167,066
  • 35
  • 309
  • 487
0

Here is example in usage with EclipseRCP & ViewPart:

http://javawiki.sowas.com/doku.php?id=swt-jface:treetableviewer

To Kra
  • 3,344
  • 3
  • 38
  • 45
0

OK, thank you Alexey, it is really the truth.

Also I found a useful link here: http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet026TreeViewerTabEditing.java?view=markup

Dennis Wong
  • 189
  • 4
  • 11
  • "OK, thank you Alexey, it is really the truth." In this case you should accept it. See http://stackoverflow.com/faq#howtoask – Alexey Romanov Nov 19 '11 at 20:29