Debug Model Presentation

Since there is a generic, uniform model for debug elements in the platform, it's possible to provide a starting point for implementing a debugger UI. The heart of the debugger UI support is the debug model presentation (IDebugModelPresentation). The debug model presentation is responsible for providing labels, images, and editors associated with specific debug elements.

Plug-ins that define their own debug model typically provide a debug model presentation for displaying debug elements in the model. This is accomplished using the org.eclipse.debug.ui.debugModelPresentations extension point. This extension point allows an implementation of IDebugModelPresentation to be associated with the identifier of a particular debug model.

Recall that debug model elements know the id of their originating debug model. This means that given any debug element, the debug platform can obtain the id of the debug model and then query the extension registry for any corresponding debug model presentations.

The markup for adding a debug model presentation looks like this:

<extension point = "org.eclipse.debug.ui.debugModelPresentations"> 
         <debugModelPresentation
             class = "org.eclipse.jdt.internal.debug.ui.JDIModelPresentation"
             id = "org.eclipse.jdt.debug"
             detailsViewerConfiguration = "org.eclipse.jdt.internal.debug.ui.display.DetailsViewerConfiguration">
          </debugModelPresentation> 
</extension>

An optional detailsViewerConfiguration can be specified in addition to the debug model presentation. The details viewer must extend the JFace SourceViewerConfiguration class. The meaning of "details" is interpreted by the debug model. The details are computed by the debug model presentation and passed to the details viewer. For example, the Java debugger uses the details viewer to show code assist in the variables view when expressions are evaluated.

Implementors of IDebugModelPresentation may also implement IDebugEditorPresentation when more control is needed over the editor that is displaying source code for a stack frame. Implementors may control the editor's position or the annotations in the source.