Add a class for the action
The class that was specified in the markup must be created to take care of the invocation of the plug-in.
Create a class named org.eclipse.hyades.demo.analyzerview.ViewAction1
that extends
org.eclipse.jface.action.Action
. Right-click on ViewAction1 in the Package Explorer view.
Click Source > Override/Implement Methods.... Choose the Action run() method. Click OK.
The method run()
in ViewAction1
will be invoked
when a user clicks on the analyzer's Open With
option. A plug-in developer may decide to put code in
run()
to invoke the view class. However, let's test what has been written so far to make sure everything is working.
Launch the Runtime Workbench in Debug mode, then go to the Profiling and Logging perspective.
Import a Profiling File or profile something briefly. Right-click on a monitor in the Profiling Monitor view, go to Open With:
the option Demo Analyzer View should be available. Put a breakpoint on the ViewAction1 run()
method. Clicking on the Demo Analyzer View menu item should invoke the ViewAction1 run() method.
Figure 1: Demo Analyzer View in the Runtime Workbench
Related tasks
Adding a view to the Profiling and Logging Perspective
Creating the plug-in
Add a class for the view