Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Tree vs. jface.Text vs. ?(The best approach for a trace/log window)
icon3.gif  Tree vs. jface.Text vs. ? [message #646637] Wed, 29 December 2010 13:57 Go to next message
Frank Benoit is currently offline Frank BenoitFriend
Messages: 125
Registered: July 2009
Senior Member

I am not sure if this is best discussed here. But I am not sure if this specific to SWT or JFace or Eclipse functionality...

I want to create a View to show information in my application. This information is produced in sequential order, with timestamp, general information and detailed information. In a run-mode, information is appended and older lines can be deleted, like a ring buffer (e.g. 50000 records). If paused, the user can sort, filter and expand records.

There is this screenshot of an application that has something, I like to have:

see the Trace window in the lower part of the window. (Not the one with the mouse pointer, the one below that)

  • There are top level lines that show summarized information in a kind of table like manner. But the lines can be expanded to show details.
  • Child lines are not depending on the columns or the top level lines.
  • Lines can be selected, e.g. for copying or to define a reference time stamp.
  • The information is not editable, no text cursor is shown.
  • The top level lines should be sortable with various criteria.
  • The user can define the columns to show and their order
  • Icons shall be possible to show the type of an entry, on every line
  • Use fixed width font to show detailed info with correct indention
  • Optional: Tooltip with even more information of the hovered line.

What is a possible approach?
SWT Tree (JFace TreeViewer), JFace Text, SWT Browser, ... ?
Performance is not unimportant.

I don't think SWT Tree is possible, because the child lines depend on the columns also. Is that true?

With JFace text? The tree behavior with text folding and the line icons with annotations? What will be the pro and contra arguments? Is it possible to make it not have a cursor? Is it possible to make it behave like one or multiple line can be selected as a whole?

SWT Browser, could be possible with javascript and perhaps AJAX? Is it possible to have enough control over this widget? Like scrolling behaviour, appending data, ...

Thanks for your time reading this


Re: Tree vs. jface.Text vs. ? [message #647955 is a reply to message #646637] Mon, 10 January 2011 15:29 Go to previous messageGo to next message
Grant Gayed is currently offline Grant GayedFriend
Messages: 2151
Registered: July 2009
Senior Member
Hi Frank,

Here are some possibilities:

1. Tree/TreeViewer are generally constrained by defined columns, but you could still probably use them if you used custom draw to render the items that don't want this constraint (or for that matter, any other native Tree-imposed constraints as well, such as all first-column items having identically-sized images). Relevant links:

- custom draw aritcle (SWT): tomDrawingTableAndTreeItems/index.html
- swt example snippet with text spanning columns: ippets/src/org/eclipse/swt/snippets/
- custom draw example snippet (JFace): snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippe ts/viewers/

2. Using a Browser could also work, since Java<->JS communication is in place as of Eclipse/SWT 3.5. Example snippets:

- JS->Java: eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet307 .java
- Java->JS: eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet308 .java

3. (probably a long shot) The Nebula project has an emulated control called Grid, which is Tree-like. I don't know if it would meet your needs any better than an swt Tree+custom draw, but if #1 and #2 aren't satisfactory for some reason then you can at least have a look at Grid. It lives at .

Re: Tree vs. jface.Text vs. ? [message #648211 is a reply to message #647955] Tue, 11 January 2011 19:28 Go to previous message
Frank Benoit is currently offline Frank BenoitFriend
Messages: 125
Registered: July 2009
Senior Member
Hello Grant,

thanks for your answer. I had completely forgotten about the owner draw feature. That seems to be the solution to me.
Thank you!

Previous Topic:Query current activation state of handlers in plugin.xml
Next Topic:Replace log file writer
Goto Forum:

Current Time: Tue Jun 19 01:17:19 GMT 2018

Powered by FUDForum. Page generated in 0.01854 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top