Os Eclipse Ganymede Pt1 PDF

  • View
    10

  • Download
    4

Embed Size (px)

Text of Os Eclipse Ganymede Pt1 PDF

Using Eclipse Ganymede to develop for the desktop, Web and mobile devices, Part 1: Developing for the Rich Client Platform, the Ganymede wayDesktop applications with RCP, Subversion and p2Skill Level: Intermediate Suresh Krishna Software Developer Freelance Developer Trebor Fenstermaker Software Consultant Sunnyside Avenue Software, LLC

02 Sep 2008 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.

Section 1. Before you start

Developing for the Rich Client Platform, the Ganymede way Copyright IBM Corporation 2008. All rights reserved.

Trademarks Page 1 of 74

developerWorks

ibm.com/developerWorks

This tutorial is for any Eclipse developer who wants to learn about some of the exciting new features available in Ganymede and for anyone interested in using these features to develop applications that can be deployed on multiple platforms with common code base. You should have an understanding of how to program in the Java programming language, and familiarity with the Eclipse platform and its model of using plug-ins.

About this seriesPart 1 ("Developing for the Rich Client Platform, the Ganymede Way") provides an introduction to the new features of the RCP, the new Subversion Eclipse integration, and the p2 packaging and distribution system. Part 2 ("Take it to the Web") introduces the Rich Ajax Platform (RAP) to write applications for the Web. And Part 3 ("Going Mobile") discusses how to use the embedded Rich Client Platform (eRCP) to develop an application for a mobile device.

About this tutorialThe RCP is an Eclipse architecture that allows a developer to pick and choose the Eclipse plug-ins needed and only those needed to build a client desktop application. To demonstrate some of the new features of Ganymede, you will develop a simple RCP application (a personal organizer). In doing so, you will see some of the changes to the RCP in Ganymede, and you will use this application to explore the new Subversion source control and p2 packaging and distribution systems. Topics include: How to download and install the Ganymede packages. How to set up the Subversion client and store your source in Subversion. How to set up the target platform and switch from one operating system to another (i.e., Mac OS X to Microsoft Windows Vista). How to create an application model and user plug-ins. How to create a product definition and package and distributing your application using p2.

System requirementsYou need the following technologies to follow along:

Developing for the Rich Client Platform, the Ganymede way Copyright IBM Corporation 2008. All rights reserved.

Trademarks Page 2 of 74

ibm.com/developerWorks

developerWorks

Eclipse Ganymede is at the Eclipse Foundation. The Java 2 Standard Edition V5 or greater is available from Sun Microsystems.

Section 2. Getting started with GanymedeBefore you begin developing your personal-organizer application, you need to download and install the Ganymede package of Eclipse. In this section, you'll see where to download it from and how to set it up to get you going.

Downloading GanymedeThe Ganymede package represents the next incremental release for Eclipse, and as such, means a new installation of the Eclipse platform. As with all Eclipse releases, there are a number of packages to choose from, depending on your development needs. The Eclipse Web site provides a comparison chart, which you can see in Figure 1. Figure 1. Comparison of Eclipse packages

Developing for the Rich Client Platform, the Ganymede way Copyright IBM Corporation 2008. All rights reserved.

Trademarks Page 3 of 74

developerWorks

ibm.com/developerWorks

For the purposes of this series, you can download the RCP/plug-in version, as it has everything you need to develop and deploy an RCP application (see Figure 2). Choose the version for your operating system, select an appropriate mirror, and download. (The file is quite large close to 200 MB, depending on your platform so be patient.)

Developing for the Rich Client Platform, the Ganymede way Copyright IBM Corporation 2008. All rights reserved.

Trademarks Page 4 of 74

ibm.com/developerWorks

developerWorks

Figure 2. Download page for RCP/plug-in package of Eclipse Ganymede

Installing and runningWhen the download is complete, unzip the package where you want Eclipse to be

Developing for the Rich Client Platform, the Ganymede way Copyright IBM Corporation 2008. All rights reserved.

Trademarks Page 5 of 74

developerWorks

ibm.com/developerWorks

installed, then double-click the Eclipse icon to run. Select a workspace, and Eclipse will take you to the welcome page. From here, choose the Workbench icon (the arrow on the far right of the welcome screen, shown in Figure 3). Figure 3. Welcome screen for Eclipse setup

So far, none of this is much different from previous releases of Eclipse, though in the next section, you will see some incremental improvements to one of the core components of Eclipse development: the Rich Client Platform. You have now installed the Ganymede release. But, you may be surprised to learn you haven't installed every package that is part of Ganymede. Next, when you explore Subversion, you will have to separately download and install the relevant package. Although Subversion is considered part of the Ganymede release, licensing restrictions prevent it from being distributed automatically with the rest of the package, requiring you to perform a separate download from within Eclipse.

Section 3. Subversion control using the SubversiveDeveloping for the Rich Client Platform, the Ganymede way Copyright IBM Corporation 2008. All rights reserved. Trademarks Page 6 of 74

ibm.com/developerWorks

developerWorks

plug-inSource control is an essential part of any serious software development effort, especially one that supports development distributed across a geographically distributed team (this tutorial's co-authors, for example, are on opposite sides of a continent). Such a system allows for uncoordinated changes to a code base, without fear of one programmer making changes that will adversely affect another yet without a central authority governing the entire process or the need of close and careful coordination between the programmers. Subversion is an open source version-control system, similar to CVS, but widely considered its eventual successor. Subversion support for Eclipse has been available for many years using third-party plug-ins, the most popular of which was called Subversive. The Ganymede project took on development of Subversive and added it as a core library of Eclipse. However, outstanding legal issues prevent it from being distributed with the rest of Ganymede, so, for now at least, you must still separately install the Subversive plug-in from within Ganymede. Follow along to see how we set up Subversive and used it to manage the source code for the personal-organizer application.

Install SubversiveSubversive consists of two parts, each of which must be separately installed. The first is the Subversive plug-in itself, which provides the UI elements to integrate Subversion support into Eclipse. The second part is the connector libraries, and these are separately developed and licensed. To install the Subversive plug-in from within Eclipse, navigate to Help > Software Updates. Figure 4. Software Updates from the Help menu

Developing for the Rich Client Platform, the Ganymede way Copyright IBM Corporation 2008. All rights reserved.

Trademarks Page 7 of 74

developerWorks

ibm.com/developerWorks

Choose the Available Software screen, then click Add Site. For the Location, enter http://download.eclipse.org/technology/subversive/0.7/update-site/ and click OK. Figure 5. Add Site for Subversive

This will add a list of related plug-ins, but before installing those, click Add Site again, and add the location for the Subversive connectors. Enter http://www.polarion.org/projects/subversive/download/eclipse/2.0/update-s for the location and click OK. Figure 6. Add site for Subversive connectors

Developing for the Rich Client Platform, the Ganymede way Copyright IBM Corporation 2008. All rights reserved.

Trademarks Page 8 of 74

ibm.com/developerWorks

developerWorks

You'll see that both update sites have added a number of different possible plug-ins. You can select them all, but the minimal required for now are the ones labeled SVN Team Provider and the Subversive SVN Connectors. Select it from the list and click Install. Figure 7. Subversive plug-ins

Developing for the Rich Client Platform, the Ganymede way Copyright IBM Corporation 2008. All rights reserved.

Trademarks Page 9 of 74

developerWorks

ibm.com/developerWorks

Eclipse will take you through a standard set of screens for insta