Sunday, December 9, 2012

Headless RCP - simple

Introduction

Creating headless RCP for Juno (eclipse 4) seems to be straightforward, but some tricky configuration and setup is required to have a working headless RCP. This article aims to show the procedure for making headless RCP for Juno.

Procedure

Start with Plug-in Project

PastedGraphic-2012-12-9-18-54.png

PastedGraphic1-2012-12-9-18-54.png

Don’t forget to unchkec “This plug-in will make contributions to the UI”.

PastedGraphic2-2012-12-9-18-54.png

No template to use.

PastedGraphic3-2012-12-9-18-54.png

Now, you have the skeleton code.

PastedGraphic4-2012-12-9-18-54.png

Setup MANIFEST.MF

Go to the Extensions tab. You need an “Extension Point” so that you can make an eclipse application.

PastedGraphic6-2012-12-9-18-54.png

Click right button to add “run”.

PastedGraphic7-2012-12-9-18-54.png

Make the class name as “Application”, clicking “class*”, you can open the Java source.

PastedGraphic8-2012-12-9-18-54.png

PastedGraphic9-2012-12-9-18-54.png

Just add one line of code.

PastedGraphic10-2012-12-9-18-54.png

The default id is “id1” or similar, you may change it into some meaningful name editing “plgin.xml”.

PastedGraphic11-2012-12-9-18-54.png

Setup “Run Configurations”

You can execute the application, but you need to setup using “Run Configurations…”.

PastedGraphic12-2012-12-9-18-54.png

In the Arguments, you need to add “-clean” for preventing “Workibench has not been created yet” error.

PastedGraphic13-2012-12-9-18-54.png

You need to click “Add Required Plug-ins” to make sure all the plugins are included in launching headless RCP.

PastedGraphic14-2012-12-9-18-54.png

You can change the workspace location for the headless RCP. As the headless RCP you are making is an eclipse, you can set where it finds the workspace for its own purposes.

PastedGraphic15-2012-12-9-18-54.png

You also need to check if you set the “Run an application” correctly set to your application.

1__%252524%252521%252540%252521__PastedGraphic-2012-12-18-18-54.png

Launch the RCP

You can click the run button and select the application you just created.

PastedGraphic17-2012-12-9-18-54.png

PastedGraphic16-2012-12-9-18-54.png

Reference

No comments:

Post a Comment