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: 179
Registered: July 2009
Senior Member
Hi,

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:

http://www.vector.com/portal/medien/ecu_testing/scope/linstress.png

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

Frank


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: 2150
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):
http://www.eclipse.org/articles/article.php?file=Article-Cus tomDrawingTableAndTreeItems/index.html
- swt example snippet with text spanning columns:
http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.swt.sn ippets/src/org/eclipse/swt/snippets/Snippet239.java?view=co
- custom draw example snippet (JFace):
http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.jface. snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippe ts/viewers/Snippet010OwnerDraw.java?view=markup

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

- JS->Java: http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/org. eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet307 .java
- Java->JS: http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/org. 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 http://eclipse.org/nebula/ .

HTH,
Grant
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: 179
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!

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


Current Time: Wed Sep 25 17:03:57 GMT 2024

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

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

Back to the top