Eclipse 4

Eclipse 4 Context Explorer

Eclipse 4 context explorer

For the presentation that I have given at Eclipse Con in Boston, I had to develop a small tool to help  the understanding of my slides.

This tool happens to be very practical, so I have decided to publish it on github (under EPL license). Since its first release, it has evolved a lot and I use it for each Eclipse 4 training.

Overall, it’s a E4 ‘Part’ containing a  TreeViewer and a synchronized TableViewer that display all the available contexts and which allows to see all available objects for each context.  The root elements in the tree are all the E4 contexts created for each bundle (the default one is the context for org.eclipse.e4.ui.workbench).

Here’s the result:

ContextExplorerPart

You have also a search box to find all the keys or classes containing the string (the nodes of the tree are also colored in blue if the associated context contains the string).

In order to use it, import the github project in your workspace, add a dependency (optional or not) on this plugin, then reference the part to where you need it in your application model by using the following URL:

bundleclass://com.opcoach.e4.contextExplorer/com.opcoach.e4.contextExplorer.parts.ContextExplorerPart

So for example we get:
ContextExplorerUsage

 

This is useful during the development phase. I also heard that there is an equivalent in E4 tools, but nobody really knows where exactly!

I am inviting you to look  at the code. Perhaps, this will help you understand a bit better how injection works.

Leave a Reply