SWT Customs - Buried treasures in the Eclipse IDE
8. August 2006
Have you ever recognized the complex widgets that are implemented in the IDE plugins?- The most different use cases shipped by plugins like the Compare-Plugin, Team-Plugin, JDT-Plugin are realized with very good looking and also good feeling widgets. So I thought I try to encapsulate such a widget that I can use it in every context. This article gives an overview about a DetailedSectionViewer, which is based on the org.eclipse.ltk.internal.ui.refactoring.history.RefactoringHistoryControl.
Detail Viewer in the IDE
An often used use case is a JFace-Viewer with a detailed section. Especially on PropertyPages such viewers can be found but are often implemented in a different way and look a bit different. See the examples below
Implementation
The Base-Class for rendering such a viewer was copied from the eclipse-framework and customized. The important changes were the deletion of the special context, so that it ca be used on different places in different contexts. I tried to keep the way of customizing the widget, that means you’re just overwriting special methods for your purposes.
Features
- custom StructuredViewer as base with Header
- Right Button Bar
- Bottom Button Bar
- Toolbar for the Viewer
- customizing the Detail-Section
- Changing weight of viewer and detail-section
- Maximizing the viewer on Pane-Header doublecklick
Examples

Simple Example with a simple TableViewer and without detail-section

TreeViewer with a detailed section (Textarea) and Right button bar

TreeViewer with an embedded TableViewer and Toolbar

TreeViewer with an embedded DetailViewer as detail-section and bottom button bar
Downloads
Download the ViewPane with Examples as Plugin (Source included - 60 kbyte)
Download the ViewPane with Examples as RCP (Source included - 9,3 Mbyte)
CVS-Checkout (more info)



Wonderfull, I’ve been following your RCP blog for a month now and I have to say it helped me a lot !
Thanks for all those tips
Fred
Comment by Fred — 9. August 2006 @ 08:39
I downloaded the ViewPane with Examples and I found no source attached.
Comment by Ioana — 26. December 2007 @ 14:58
You’ll find the sources in the plugin-jars (folder ’src’)
Comment by Tom Seidel — 7. January 2008 @ 18:13