Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Eclipse Platform Release 3.0
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.eclipse.debug.ui
Interface IDebugModelPresentation

All Superinterfaces:
  IBaseLabelProvider, ILabelProvider, ISourcePresentation

public interface IDebugModelPresentation
extends ILabelProvider, ISourcePresentation

A debug model presentation is responsible for providing labels, images, and editors associated with debug elements in a specific debug model. Extensions of type `org.eclipse.debug.ui.debugModelPresentations` implement this interface. Generally, a debug model implementation will also provide a debug model presentation extension to render and display its elements. A debug model presentation is registered for a specific debug model, and is responsible for the presentation elements defined/implemented by that model.

A debug model presentation extension is defined in `plugin.xml`. Following is an example definition of a debug model presentation extension.

     <extension point="org.eclipse.debug.ui.debugModelPresentations">
       <debugModelPresentation
          id="com.example.debugModelIdentifier"
          class="com.example.ExamplePresentation"
          detailsViewerConfiguration="com.example.ExampleSourceViewerConfiguration">
       </debugModelPresentation>
     </extension>

The attributes are specified as follows:

- `id` specifies the identifier of the debug model this presentation is responsible for. Corresponds to the model identifier returned from a debug element - see `IDebugElement.getModelIndentifier`
- `class` specifies the fully qualified name of the Java class that implements this interface.
- `detailsViewerConfiguration` optionally specifies the fully qualified name of the Java class that is an instance of `org.eclipse.jface.text.source.SourceViewerConfiguration`. When specified, the source viewer configuration will be used in the "details" area of the variables and expressions view when displaying the details of an element from the debug model associated with this debug model presentation. When unspecified, a default configuration is used.

To allow for an extensible configuration, this interface defines a `setAttribute` method. The debug UI plug-in defines one presentation attribute:

- `DISPLAY_VARIABLE_TYPE_NAMES` - This is a boolean attribute indicating whether variable elements should be rendered with the declared type of a variable. For example, a Java debug model presentation would render an integer as `"int x = 3"` when true, and `"x = 3"` when false.

Clients may define new presentation attributes. For example, a client may wish to define a "hexadecimal" property to display numeric values in hexadecimal. Implementations should honor the presentation attributes defined by this interface where possible, but do not need to honor presentation attributes defined by other clients. To access the debug model presentation for a debug view, clients should use `IDebugView#getPresentation(String)`.

Clients may implement this interface.

See Also:
  `IDebugElement`, `ILabelProvider`, `IDebugView`

Field Summary
`static String` | `DISPLAY_VARIABLE_TYPE_NAMES` Variable type names presentation property (value `"org.eclipse.debug.ui.displayVariableTypeNames"`).

Method Summary
`void` | `computeDetail(IValue value, IValueDetailListener listener)` Computes a detailed description of the given value, reporting the result to the specified listener.
`Image` | `getImage(Object element)` Returns an image for the element, or `null` if a default image should be used.
`String` | `getText(Object element)` Returns a label for the element, or `null` if a default label should be used.
`void` | `setAttribute(String attribute, Object value)` Sets a presentation attribute of this label provider.

Methods inherited from interface org.eclipse.jface.viewers.IBaseLabelProvider
`addListener, dispose, isLabelProperty, removeListener`

Methods inherited from interface org.eclipse.debug.ui.ISourcePresentation
`getEditorId, getEditorInput`

Field Detail

### DISPLAY_VARIABLE_TYPE_NAMES

    public static final String DISPLAY_VARIABLE_TYPE_NAMES

  Variable type names presentation property (value `"org.eclipse.debug.ui.displayVariableTypeNames"`). When `DISPLAY_VARIABLE_TYPE_NAMES` is set to `true`, this label provider should include the reference type of a variable when rendering variables. When set to `false`, this label provider should not include the reference type of a variable when rendering variables.

  See Also:
    `setAttribute(String, Object)`

Method Detail

### setAttribute

    public void setAttribute(String attribute,
                             Object value)

  Sets a presentation attribute of this label provider. For example, see the presentation attribute `DISPLAY_VARIABLE_TYPE_NAMES` defined by this interface.

  Parameters:
    `attribute` - the presentation attribute identifier
    `value` - the value of the attribute

### getImage

    public Image getImage(Object element)

  Returns an image for the element, or `null` if a default image should be used.

  Specified by:
    `getImage` in interface `ILabelProvider`
  Parameters:
    `element` - the debug model element
  Returns:
    an image for the element, or `null` if a default image should be used
  See Also:
    `ILabelProvider`

### getText

    public String getText(Object element)

  Returns a label for the element, or `null` if a default label should be used.

  Specified by:
    `getText` in interface `ILabelProvider`
  Parameters:
    `element` - the debug model element
  Returns:
    a label for the element, or `null` if a default label should be used
  See Also:
    `ILabelProvider`

### computeDetail

    public void computeDetail(IValue value,
                              IValueDetailListener listener)

  Computes a detailed description of the given value, reporting the result to the specified listener. This allows a presentation to provide extra details about a selected value in the variable detail portion of the variables view. Since this can be a long-running operation, the details are reported back to the specified listener asynchronously. If `null` is reported, the value's value string is displayed (`IValue.getValueString()`).

  Parameters:
    `value` - the value for which a detailed description is required
    `listener` - the listener to report the details to asynchronously
  Since:
    2.0

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Eclipse Platform Release 3.0
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp. and others 2000, 2004. All rights reserved.