Working with the Navigator Extension Sample

Introduction

This sample demonstrates the extending of Hyades navigators (e.g. Profiling Monitor, Log Navigator) to contribute additional content to the navigators. This can include any new items, both top-level and children of existing items, and context menu contributions to both new and existing items.

Contents

The sample contains code that implements a simple extension to the Profiling Monitor navigator. A new action "Add Sample Item" is contributed to the context menu of every existing type containing data (i.e. Monitor, Node, Process, and Agent). This action creates a new item under the selected one, which contains the same data as its parent. The sample items can be viewed with the Memory Statistics view, and are non-persistent (they cannot be saved).

Requirements

Hyades 3.0 or above.

Viewing the sample

The following procedure outlines the steps needed to view the contributions to the Profiling Monitor navigator made by this sample extension:

  1. Launch an instance of a Runtime Workbench.
  2. Switch to the Profiling Monitor navigator view in the Profiling perspective.
  3. Populate the Profiling Monitor view by either profiling an application or importing a profiling file. The navigator should contain a Project, Monitor, Node, Process, and an Agent.
  4. Right-click on any item other than the project. Note the presence of the Add Sample Item at the top of the context menu. Select it. Note the presence of a new Sample Item under the selected one.
  5. Right-click on the newly created item. Note the Delete action is enabled, but the Save action is disabled. The sample items are non-persistent, however extensions can add saving functionality as desired.
  6. Delete the sample item. This removes the item from the navigator view.
  7. Right click on the project. Note the absence of the Add Sample Item in the context menu. Extensions can selectively contibute actions to specific items at runtime.