## 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 new items (both top-level and children of existing items) and context menu contributions to both new and existing items. A new filter set is defined that filters out any new 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 Package Statistics view, and are non-persistent (they cannot be saved). A new filter set labeled "Sample Items" is also contributed to the Profiling Monitor navigator. When selected, no sample items will be displayed.

### 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. Remove any filters on the navigator by clicking on the view menu arrow, and unchecking all the items.
4. 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.
5. 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.
6. 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.
7. Open the Profiling Monitor's view menu (down arrow in toolbar). Note the presence of a "Hide Sample Items" common filter.
8. In the view menu, click on "Filters...". Note the filter set is also present in this dialog.
9. Enable the "Hide Sample Items" filter. Any sample items in the navigator are now hidden.
10. Disable the filter and delete the sample item. This removes the item from the navigator view.
11. 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.