Thursday, February 15, 2007

Custom Detail Pane Widgets

First off, let me introduce myself to all you avid Debug Team Blog readers. My name is Curtis Windatt and I am the newest member of the debug team. I have been working with Darin and Mike at IBM in Winnipeg for almost four months now and I am looking forward to receiving commit rights to the debug projects in the not so far off future.

The first major feature I worked on is adding support for custom detail pane widgets (Bug 75852). This feature allows plugins to contribute new detail panes. The “detail pane” is the area in the variable, expressions and registers view that displays information about the currently selected variable. Up until now, the detail pane could only display text.

Now it can display colours! This custom pane changes background colours depending if the selected element is public/private/etc:

Of course, it can display much more than that. A custom detail pane is defined by implementing org.eclipse.debug.ui.IDetailPane. The pane can contribute any SWT Control, including Composites that contain multiple controls, to the detail pane. When the user makes a selection the custom pane is passed the selection so it can display the information however it wants. The user can use the context menu to choose between the different detail panes available for the current selection.

To contribute a custom detail pane you must use the new extension point org.eclipse.debug.ui.detailPaneFactories. At this extension point you specify a class implementing org.eclipse.debug.ui.IDetailPaneFactory. Each contributed factory will be asked what detail panes that factory can produce for a given selection. A factory can offer different combinations of detail panes depending on the selection. For example, a pane might only be available when 2 or more java variables are selected. To reduce plugin loading, plugins can also add enablement expressions to the extension so that the factory is only instantiated if the selection applies.

We are looking forward to seeing what people can do with this new feature. Leave a comment or send us an e-mail if you create one. In the future we will try to make an example plugin and possibly a short tutorial available.