Thermostat/DevelopingEclipseClient

From IcedTea

Jump to: navigation, search

Thermostat Home

This page provides instructions for developers to start working on the Thermostat Eclipse client. The guide will walk through building the Eclipse plug-ins, setting up an Eclipse workspace to develop the plug-ins, and run the plug-ins in a child instance of Eclipse.

Contents

1 IMPORTANT INFORMATION

The eclipse client has in fact been completely deprecated and removed from the source tree. This page is kept intact for historical reasons. If you are interested in resurrecting the eclipse client, and can commit to bringing current swing client features to the eclipse client and maintaining it over the long run, please reach out to the Thermostat team through our mailing list or IRC channel.

2 Installing Eclipse

The first thing we'll need to do is install Eclipse. Since we'll be doing Eclipse plug-in development, we want to make sure we install the Eclipse Plug-in Development Environment (PDE). You can download Eclipse with PDE included from the Eclipse Classic package at http://www.eclipse.org/downloads/.

Your Linux distribution may provide an Eclipse package as well. If using Fedora, you can install Eclipse with PDE as follows:

 $ yum install eclipse-pde

3 Download Thermostat Sources

IMPORTANT INFORMATION: The eclipse plugin has been entirely obsoleted and removed from the source tree. Thanks to the magic of Mercurial, however, you can still access it! The removal was done in one rather large changeset, which has been tagged as "eclipse-client-removed". Applying this change in reverse will provide you with the most up-to-date version of the Thermostat eclipse client that ever existed.

Now we need to obtain the latest Thermostat sources from our Mercurial repository:

$ hg clone http://icedtea.classpath.org/hg/thermostat

The Eclipse plug-ins are located in the 'eclipse' directory at the top-level of the Thermostat source tree.

4 Building Core Thermostat & Eclipse Client

Now we will build both Thermostat and the Thermostat Eclipse client in one-shot using a Makefile provided for just this purpose.

$ cd /path/to/thermostat/clone

To build, you have two options:

  • During the course of the build, Eclipse client tests will spawn Eclipse workbench windows. This may be annoying, and could also cause tests to fail if you accidentally interact with those windows.
$ make
  • If you have a VNC server installed, you may choose to run the Eclipse client tests headlessly using VNC.
$ make USE_VNC=true

5 Importing Eclipse Client Plug-ins into Workspace

Start Eclipse and select the workspace you would like to use. Then to import the Eclipse client plug-ins into the workspace, navigate to: File -> Import -> General -> Existing Projects into Workspace. For Select root directory, browse to the root of your Thermostat checkout and select the 'eclipse' directory. Leave all projects checked and hit Finish.

Image:eclipse-import-projects.png


Once Eclipse has finished building the workspace, you will see several errors. This is because we are missing several dependencies of the Eclipse plug-ins.

Image:eclipse-errors.png

6 Setting the Target Platform

In your workspace, open the project 'com.redhat.thermostat.eclipse.target_platform', and open the file 'target/thermostat-juno.target'. This file specifies where to obtain the dependencies we need. Once newer versions of Eclipse are released, newer target definitions will be made available. For instance if you are using Eclipse 4.3 (Kepler), use the 'target/thermostat-kepler.target' definition file. Image:open-target-def.png


In the upper right-hand corner of the editor for thermostat.target, click "Set as Target Platform". Now all errors in the workspace should be resolved.

Image:eclipse-target-platform.png

7 Creating a Launch Configuration

In order to launch our plug-ins, we need to create a Launch Configuration. Select Run -> Run Configurations, and create a new Eclipse Application launch configuration. Select the 'Plug-ins' tab. Under 'Launch with', change the value to 'plug-ins selected below only'. Check "Workspace" to include all of our Thermostat Eclipse plug-ins.

Image:eclipse-launch-config-workspace-plugins.png


Now scroll down to 'Target Platform'. For each Thermostat bundle (e.g. those starting with "com.redhat.thermostat"), set the 'Auto-Start' value to true.

Image:eclipse-auto-start.png


In the 'Arguments' tab add the following to 'VM Arguments':

-Djava.library.path=${project_loc:com.redhat.thermostat.client.feature}/${target.os}_${target.arch}

Image:eclipse-library-path.png

8 Launching the Eclipse Client

With our launch configuration complete, select 'Run' in the launch configuration dialog. This configuration will be saved for future launches. A new instance of Eclipse will now start up, which includes our Thermostat plug-ins.

Now we need to start the Thermostat agent and storage. For this example we'll do this using the service command. After navigating to your Thermostat clone, perform the following on the command line:

$ cd distribution/target/bin
$ ./thermostat service

Back in our child instance of Eclipse, open the 'Thermostat' perspective. In the Hosts/VMs view, click 'Connect'. This will connect to the storage instance we just started.

Image:eclipse-connect.png


After successfully connecting to Thermostat storage, you can now use the Thermostat Eclipse Client. Now you can make changes to the plug-ins' source in your development workspace and simply relaunch your child Eclipse workbench to see those changes in action.

Image:eclipse-done.png

Personal tools