Tutorial Using Zephyr Plugins

This tutorial is for people that would like to run Zephyr directly from Eclipse or embed Zephyr in a Eclipse application.

1. Requirements installation

  • See the download page to install Zephyr plug-ins for Eclipse
  • Make sure the plugins for Eclipse for RCP and RAP Developers are installed

2. Having an Eclipse Plug-in Project:

The first thing you need to do is to contribute to Zephyr (with your code generating the data you want to plot) is an Eclipse Plug-in Project. The first way is to create a new project:
  • File->New->Other...
  • Select Plug-in Project (in Plug-in Development) then push Next
  • Give the project a name then push Next and then Finish
The second way is to transform an existing Java Project in your Eclipse into a Eclipse Plug-in Project:
  • Right-click on your Java project and then Configure -> Convert to Plug-in Projects...
  • Select your project and then click Finish

3. Making your project work with Zephyr:

When Zephyr starts, it needs to know what to run in your code. To this purpose, we use the Extension framework of Eclipse:
  • Open the file META-INF/MANIFEST.MF (this file should exist for every Eclipse Plug-in Project)
  • Click on the tab Dependencies then click Add... then select zephyr.plugin.core and zephyr.plugin.core.api then click Ok
  • Click on the tab Extensions then click Add... then select zephyr.runnable then click Finish
  • Click right on the extension then New->client
  • Click on the new client and set a class (click on the link class to create a new one or browse to select an existing one). This class must implement the interface java.lang.Runnable
  • Save the file
If the attribute autostart=true, Zephyr will run your client at startup in its own thread. When autostart=false, then you need to pass the id of the client at the command line for Zephyr to start it up (see below).

When Zephyr starts, it requests to Eclipse every clients in plugins that provide zephyr.runnable extension and then start each client provided by the extension in its own thread.

See the Java Archive tutorial for declaring data to monitor for Zephyr.

4. Running Zephyr with your client

  • Go to: Run -> Run Configurations...
  • On the left, right click on Eclipse Application then New
  • Give a name to your configuration
  • In Run a product: select zephyr.product.product
  • Select the tab Plug-ins
  • In Launch with: select plug-ins selected below only
  • Click Deselect All then select your Eclipse Plug-in Project (e.g. select zephyr.example.simpleplugin) and click Add Required Plug-ins
  • If autostart=false in the client of your zephyr.runnable extension, then you need to add the id (not the class) of your client to the program arguments:
    • Select the tab Arguments
    • Add to Program arguments the id of your client (e.g. zephyr.example.simpleplugin.client)
    • Note: you can find the id by opening the file plugin.xml of your project, then the tab Extensions, then select your client in zephyr.runnable, finally check the field id
  • Click on Run
Zephyr will start with an empty plot view. To select traces (data), press S in the Graphs view or go to Plotting->Select Traces... or click in the toolbar. You can add views by going to Window->New Plot You can move the views by dragging their tab title.

Links: