Simple tips to utilize the JFace Tree audience

Summary The objective of the article is always to educate you on simple tips to utilize TreeViewers in your Eclipse plug-ins or stand-alone JFace/SWT applications. We’ll focus on a example that is simple progressively include functionality.

By Chris Grindstaff, Applied Reasoning ( chrisg at appliedReasoning.com) May 5, 2002

Introduction

The tree audience can be utilized in Eclipse plug-ins or in a stand alone JFace/SWT application. We’ve chosen to make usage of a plug-in that shows the tree audience functionality.

Here’s a typical example of just what the plugin provides:

You may notice the occasional as you work through the article . These icons suggest points for which you should launch Eclipse and attempt the instance.

Source Code

To operate the examples or see the origin with this article, unzip cbg.article.treeviewer.zip to your eclipse_root directory and restart Eclipse. In Windows the eclipse_root directory can look something such as d:\apps\eclipse\. As soon as Eclipse is restarted, find the attitude | Show View | Other… menu choice. Within the “Other” category choose “Moving Box.”

This short article be best as you read it if you are able to run the plugin we’ve provided.

Big Photo

To comprehend just how to make use of the TreeViewer, it is essential to comprehend where in fact the TreeViewer fits into JFace in general, and exactly how JFace fits into Eclipse.

JFace is a UI toolkit that helps resolve common UI development tasks. JFace additionally will act as a bridge between low-level SWT widgets as well as your domain things. SWT widgets communicate with the host system that is operating as a result don’t have any understanding of your domain things.

One of many real methods JFace bridges the gap between SWT widgets and domain models is by audiences. JFace people include an SWT widget (age.g. Tree, dining table, etc), as well as your domain things. You offer the watchers using the information they require so that you can populate the underlying SWT widget. More