Working with the Navigator Extension sample
This sample demonstrates the extending of navigators for the
Eclipse Test and Performance Tools Platform, or TPTP (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.
If you have not already done so, create the example by File >
New > Example... > Navigator Extension Sample.
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).
The following procedure outlines the steps needed to view the
contributions to the Profiling Monitor navigator made by this
sample extension:
- Launch an instance of a runtime workbench by selecting Run
> Run ... > select Eclipse Application > New > Run.
- Switch to the Profiling Monitor navigator view in the Profiling and Logging
perspective.
- Populate the Profiling Monitor view by either profiling an
application or importing a profiling file. The navigator should contain
a Monitor, Node, Process, and an Agent. If you do not see all of
those types, change the display to the distributed layout.
- Right-click on either the Monitor, Node, Process, or Agent. 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.
- 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.
- Delete the sample item. This removes the item from the navigator
view.
- Right click on the profiling type. Note the absence of the Add
Sample Item in the context menu. Extensions can selectively
contribute actions to specific items at runtime.
Related Tasks:
Profiling an application
Importing profiling resources
Opening the Profiling and Logging perspective
Using the Profiling Monitor view
Using the Memory Statistics view
(C) Copyright IBM Corporation 2000, 2008. All
Rights Reserved.