Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

Extending Eclipse monitoring, profiling, and testing functions
Previous Page Home Next Page

Creating the plug-in

Write a plug-in that extends the extension point org.eclipse.hyades.ui.analyzerExtensions. This adds an entry to the Open With menu. A plug-in project needs to be created to hold the demo analyzer plug-in's code. Follow these steps to create and prepare an analyzer plug-in project:

  1. Create a new plug-in project. In the New Plug-in Project wizard, enter project name org.eclipse.hyades.demo.analyzerview. Accept default settings. Click Next.
  2. Accept default settings. Click Finish.

A plug-in project with a MANIFEST.MF file and a plug-in class that extends AbstractUIPlugin has been created. Add the following required plug-ins to the new plug-in's dependencies:

  • org.eclipse.hyades.trace.ui
  • org.eclipse.emf.ecore
  • org.eclipse.tptp.platform.models

The demo analyzer plug-in will require the TPTP Trace Model plug-in, the TPTP Trace Core UI plug-in and the Eclipse JFace plug-in. To reference them in the demo analyzer plug-in, add the following three lines into the plug-in manifest <require> markup. The manifest should look like this:

Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
org.eclipse.hyades.trace.ui,
org.eclipse.emf.ecore,
org.eclipse.tptp.platform.models

Extend and contribute your analyzer extension by adding the following to the plugin.xml file.

   <extension
         point="org.eclipse.hyades.ui.analyzerExtensions">
         <analyzerExtension
            id="org.eclipse.hyades.demo.analyzerview.viewaction1"         
            name="Demo Analyzer View"
            extension="trace"
            type="Profiler"
            isDefault="false"
            class="org.eclipse.hyades.demo.analyzerview.ViewAction1"
            icon="icons/sample.gif">
         </analyzerExtension>
   </extension>

The four required fields are:

id
The analyzer's unique identification is specified in this tag.
name
The analyzer's name is specified in this.
extension
The tag dictates the type of object to which this analyzer is applicable; in this case it is trace objects. Other valid values for this tag include other TPTP resources such as test suite and deployment.
class
This tag specifies the name of the class when an action is invoked on the Open With menu item. This class must implement org.eclipse.jface.action.IAction.

All the other fields are optional. Note the use of tag type, which associates the analyzer with a particular type of object. Other valid values for this tag are Logging, Monitor and Host. TPTP adds the option in Open With to invoke the analyzer on any given object according to the value in type. For example, when the value is Host, the analyzer will only be available on host objects in the Profiling Monitor view.

Add a folder to the plug-in project named icons and add this icon (sample.gif) to it: sample icon

The next stage is to create the class that will perform the actions for the view.

Related tasks
Adding a view to the Profiling and Logging Perspective
Add a class for the action
Add a class for the view


 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire