Skip to main content

By clicking Submit, you agree to the developerWorks terms of use.

The first time you sign into developerWorks, a profile is created for you. Select information in your profile (name, country/region, and company) is displayed to the public and will accompany any content you post. You may update your IBM account at any time.

All information submitted is secure.

  • Close [x]

The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerworks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

By clicking Submit, you agree to the developerWorks terms of use.

All information submitted is secure.

  • Close [x]

Using Eclipse Ganymede to develop for the desktop, Web and mobile devices, Part 1: Developing for the Rich Client Platform, the Ganymede way

Desktop applications with RCP, Subversion and p2

Suresh Krishna, Software Developer, Freelance Developer
Suresh Krishna has been a programmer since 2000 and has been working on the domain modeling, IDEs, and productivity tools. Inspired by the IDE evolution and developer productivity, he works primarily on the Eclipse plug-ins and RCP applications. Extreme Programming and Scrum are his favorites, along with evangelizing Eclipse to the user, developer, and corporate communities. He enjoys his free time writing blogs and product evaluations.
Trebor Fenstermaker, Software Consultant, Sunnyside Avenue Software, LLC
Although he's programmed in Java since 1999, Trebor Fenstermaker was, for much of that time, highly suspicious of Java IDEs and was a die-hard command-line user, even doing all his code editing in vi -- until a colleague showed him that he really could be more efficient with Eclipse. He now evangelizes his fellow UNIX command-line refugees on its wonders and enjoys exploring its more powerful features -- including its endless possibilities for expansion through custom plug-ins.

Summary:  The Ganymede release of the Eclipse IDE includes 24 separate projects, covering a wide range of technologies. Many of these projects are mature, and this release provides incremental improvements to those. But Ganymede also includes a number of new projects that introduce new technologies to the Eclipse platform. In this three-part "Using Eclipse Ganymede to develop for the desktop, Web and mobile devices" tutorial series, we will cover the following new Ganymede features: RCP, RAP, and eRCP, which allow you to develop software for the desktop, Web, and mobile platforms, respectively, with one common code base; Subversion for version control; and p2 for update and installation. Here in Part 1, we will use the mature Rich Client Platform (RCP) to develop an application for the desktop using Subversion for source control, and we will package and distribute the application using p2.

View more content in this series

Date:  02 Sep 2008
Level:  Intermediate PDF:  A4 and Letter (3732 KB | 74 pages)Get Adobe® Reader®

Activity:  17532 views
Comments:  

Packaging and distributing RCP applications using p2

The last enhancement you'll look at in this tutorial is a new method of packaging and distributing plug-ins. In previous versions of Eclipse, the packaging was essentially creating a ZIP archive of all the relevant files, along with an appropriate manifest, and placing it on a publicly available server. These could then be installed either by using the Help > Updates feature from the menu, or many users simply opted to download and unzip the plug-in archive directly in the appropriate Eclipse installation folder. The p2 mechanism streamlines this process, allowing for a clean packaging and automated distribution. In this section, you'll create a p2 update site and package your plug-in for distribution through it.

Creating the feature list

Packages contain features, which themselves are composed of plug-ins. So to package your organizer plug-in for p2, you have to start by creating a feature list. You do this by using the new project wizard. From the Eclipse menu, select New > Project > Plug-in Development > Feature Project and click Next.


Figure 41. Creating a new feature project
Creating a new feature project

Name this project com.devworks.tutorial.po.feature and store it in the default location for simplicity. Leave the feature ID as its default of the project name, but change the feature name to Personal Task Organizer. Leave the rest of the fields at their defaults, then click Next.


Figure 42. Feature properties editor
Feature properties editor

Eclipse will display a screen asking for the plug-in that should be used to initialize this feature set. Since this feature set is all about your personal-organizer plug-in, select com.devworks.tutorial.po from the list, then Finish.


Figure 43. Selecting the plug-in that provides the definition of the feature
Selecting the plug-in that provides the definition of the feature

The wizard completes by creating a new project and populating a file called feature.xml. This contains information about the features, dependencies, licensing, and build instructions for your plug-ins — in short, everything needed to build a distribution.


Figure 44. The feature.xml shown in the editor
The feature.xml shown in the editor

The update site you'll create next will use this feature list.


Create the update site

Now that you have a feature set, you can use this create a site from which to distribute it. What is created is a set of files that can be made publicly available on the Internet or on a corporate intranet, or distributed on disc, or as a ZIP file. The files and structure created are simply made in a directory that you can then distribute as you wish.

Creating a new update site is simple. Once again, the New Project wizard steps in. From the Project Explorer, select New > Project > Plug-in Development > Update Site Project, then select Next.


Figure 45. Creating a new update site project
Creating a new update site project

This will start a wizard that will create a new project that represents your update site (see Figure 46). Enter com.devworks.tutorial.updatesite as the project name and save it on your local file system. (Selecting the default location will create the update site in your current workspace; choosing an external location will make this tutorial a bit clearer, but you decide.) Click Finish.


Figure 46. The update site project properties editor
The update site project properties editor

The wizard will create a project with a single site.xml file, displayed in the editor. It describes the package as the updater will see it.


Figure 47. The site.xml shown in the editor
The site.xml shown in the editor

You now need to configure that site.xml to add a category and features. This fleshes out the update site with the material you are intending it to distribute. Click New Category on the site.xml editor, and the right side of the editor will display properties you will edit (see Figure 48). Enter Personal Task Organizer for the name, and Tutorial for the label. You can enter a description of your choice; we used This is a Personal Task Organizer.


Figure 48. Adding the category
Adding the category

Now highlight the Personal Task Organizer on the left-side list box, then click Add Feature. Eclipse will display a list of available features, including the one you created earlier (see Figure 49). Select com.devworks.tutorial.po.feature from the list, then click OK.


Figure 49. Selecting the feature to add to the update site
Selecting the feature to add to the update site

This will add it to the list of features in your category.


Figure 50. Feature shown in the site.xml editor
Feature shown in the site.xml editor

You're ready to build out your distribution physically on your disk. Save your edits, then highlight the Personal Task Organizer again in the list of categories. Click Build All, and this will create an update site in your given path.

Congratulations! You have created a distribution of your organizer, suitable for publishing to the world. Let's see how it would look to a user seeking to download and install it in his Eclipse environment, by loading it into your own Eclipse environment.


Loading the local site

You will add your plug-in the same as you did the Subversive plug-in, by way of the Software Updates function. Navigate to Help > Software Updates, then click Add Site. This time, however, instead of a URL on the Web, click Local, and Eclipse will display a file browse box. Navigate to the directory where you created your update site, click OK, then OK again on the Add screen.


Figure 51. Adding the location of the new site in Software Updates
Adding the location of the new site in Software Updates

Your update site now appears in the list of available updates.


Figure 52. The organizer in the software update list
The organizer in the   software update list

To install your plug-in, select it from the list, then click Install. You will see your plug-in listed in a standard plug-in install screen.


Figure 53. The organizer installation screen
The organizer installation screen

Click Next, and you will be presented with a license screen (see Figure 54). Since you didn't enter a license, you'll see a default message, but be sure to select I accept, then click Finish.


Figure 54. Licensing terms screen
Licensing terms screen

Eclipse will install the organizer plug-in and prompt for a restart. After the restart, you will find your plug-in under Window > Show View > Other > Other.


Figure 55. Opening the organizer
Opening the organizer

Click OK, and your personal organizer will load and run within the Eclipse workbench.


Figure 56. The organizer in the Eclipse workbench
The organizer in the Eclipse workbench

Your personal organizer is now a part of your Eclipse workbench ready for you to use alongside everything else that makes up the Eclipse experience.

6 of 10 | Previous | Next

Comments



static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=Open source
ArticleID=333953
TutorialTitle=Using Eclipse Ganymede to develop for the desktop, Web and mobile devices, Part 1: Developing for the Rich Client Platform, the Ganymede way
publish-date=09022008
author1-email=suresh.madhuvarsu@gmail.com
author1-email-cc=
author2-email=tcf@sunnysideave.com
author2-email-cc=