on Oct 4th, 2010Chapter 3 errata

Page 40 — The list of steps for adding the Delta Pack to your target suggests adding the directory ${workspace_loc}/HyperbolaTarget/delta.pack to your target definition. If in fact you followed the preceding steps and imported the Delta Pack archive, you would have to add the directory ${workspace_loc}/HyperbolaTarget/delta.pack/eclipse. The “eclipse” segment is missing in the example.

Note however that in the target supplied with the Samples Manager we eliminated the “eclipse” folder in the Delta Pack and so, as shown in figure 3-4, the eclipse segment was not needed in this case.

on Oct 4th, 2010Chapter 4 errata

Page 52 — The snippet of Application code incorrectly shows the old Eclipse application run() method. The best practice for defining applications is now to implement IApplication which requires a start() and stop() methods as shown below.

public class Application implements IApplication {
	public Object start(IApplicationContext context) {
		Display display = PlatformUI.createDisplay();
		try {
			int returnCode = PlatformUI.createAndRunWorkbench(display, new ApplicationWorkbenchAdvisor());
			if (returnCode == PlatformUI.RETURN_RESTART) {
				return IApplication.EXIT_RESTART;
			}
			return IApplication.EXIT_OK;
		} finally {
			display.dispose();
		}
	}

	public void stop() {
		if (!PlatformUI.isWorkbenchRunning())
			return;
		final IWorkbench workbench = PlatformUI.getWorkbench();
		final Display display = workbench.getDisplay();
		display.syncExec(new Runnable() {
			public void run() {
				if (!display.isDisposed())
					workbench.close();
			}
		});
	}
}

Page 60 — In the description of how to get to the launch configurations (section 4.3.2) the menu path should be Run > Run Configurations… and Run > Debug Configurations….  Similarly, Figure 4-12 shows an outdated view of the Run menu.

on Sep 3rd, 2010Chapter 17 errata

Page 265 — Figure 17-1 includes a number of Java code lines involving String literals. It appears that a number of the ” (quote) characters were converted to ? (question mark) characters during the creation of the artwork. There is also a stray ? character just before the last block of code. Obviously these should be removed or replaced  to make the Java code syntactically valid.

Page 277 — In the BrowserView code snippet the “nextAction” variable declared at the beginning of createControlPart() should be named “forwardAction” to match its use in the last line of the snippet.

on Aug 27th, 20101st Edition Samples re-released

Several people have requested that the samples for the 1st Edition of the Eclipse RCP book be made available.  So, by popular demand, we have put a zipped update site on the downloads page. Note that the samples were tested for the Eclipse of the day and have not been tested on the latest Eclipse infrastructure. Most things should work but the samples may not reflect the current best practices or technology usage.

on Jul 20th, 2010Chapter 9 errata

Page 131 — In Chapter 8 we defined the Hyperbola product and set its ID. Unfortunately on page 117 of the first printing we suggested using “org.eclipsercp.hyperbola” for the product ID. In Chapter 9 when you go to export the product and use the Generate Metadata repository option in the export wizard, there is a conflict between this product id and the id of the org.eclipsercp.hyperbola bundle. The result is that the export silently fails and the output directory does not contain an executable.  To address this problem, ensure that the ID of the product in the top box of the Overview page of the product editor, is something other than org.eclipsercp.hyperbola.  For example, we suggest using org.eclispercp.hyperbola.product.

on Jul 20th, 2010Chapter 8 errata

Page 117 — In Figure 8-2 the product ID (top text box) is show an “org.eclipsercp.hyperbola”. This works fine in the sample for Chapter 8 but in subsequent chapters where building with p2 metadata is involved, that id will collide with the id of the org.eclipsercp.hyperbola bundle. We suggest changing the ID here to something like org.eclipsercp.hyperbola.product to avoid ambiguity.

Page 125 — When you add translatable messages to the plugin.properties file you should ensure that the bundle’s MANIFEST.MF is updated to indicate where the translations are to be found. For example,

Bundle-Localization: plugin

on Jul 16th, 2010Chapter 24 errata

Page 402 — The Target Export wizard was added in Eclipse 3.6.  People developing for 3.5.x can move to 3.6 since you have a distinct Target definition.  That’s the point of target platforms.  Alternatively you can use a 3.6 to do the target export and continue with 3.5.2 for the book samples.

on Jul 16th, 2010Sample code updated

I just uploaded a new version of the Eclipse RCP book second edition sample code. You can connect to the software site (http://eclipsercp.org) and updating your current Samples Manager or installing the new one if you don’t have it already installed.  We are also making available an archive of the software site for those looking to get around firewall issues.

Below is a quick summary of the changes in this new version:

  • General clean up of glitches and errata reported by readers/reviewers
  • New target platform that is smaller and more complete
  • Chapter 14 code updated to better reflect the use of p2
  • Chapter 9 product definition updated to export and produce the correct launcher on Mac
  • Fixes to avoid NPEs and other problems when login to a chat server was not possible

Check out the new samples and be sure to let us know on the forums if there are problems.

on Jul 14th, 2010Chapter 14 errata

Page 203 — The Multi-User Chat (MUC) feature mentioned in this discussion is an example only.  The sample code does not include such a feature.

Page 208 — The features to be included in the Hyperbola feature are part of the target platform. In Eclipse 3.5.x there is a PDE bug that prevents features from software sites from being added to the target platform. This has been resolved in 3.6. To work around this, we have manually added the required features to the HyperbolaTarget project’s misc/features directory.  Alternatively, you can use Eclipse 3.6 to do your development.

Note as well that the org.eclipse.equinox.p2.user.ui feature is listed as the Equinox p2 Provisioning feature in the Galileo repository and is not included in the Equinox p2 SDK feature.

Page 210 — To get a binding for %aboutText you need to tell OSGi where to find translations. Do this by adding the following header to the Hyperbola bundle manifest:

Bundle-Localization: plugin

Page 211 – To be able to run or test the new p2 function, you have to export Hyperbola and be running it as a normal application. You also need to have a repository to which you can point Hyperbola for updates or new function. You can do this with the following steps:

  • Export Hyperbola with the Generate Metadata Repository box selected
  • Copy the output Hyperbola directory to some other location  (or unzip the output zip somewhere)
  • Change the version number of the Hyperbola feature or product to simulate a change
  • Re-export Hyperbola to the same location
  • Run the original Hyperbola and add the exported “repository” directory as a local software site in the p2 Available Software Sites preferences UI. This will come up automatically if you use Help > Check for Updates
  • After updating and restarting, confirm that the update happened using About > Installation Details and look for the version number you changed
  • You can also create some new features and export them to the same repository.  They will then show up in the Install New Software UI

on Jul 14th, 2010Chapter 13 errata

Page 188 — The third step says to use the filter box to find the Help feature.  Due to a bug in the way PDE works, doing this can sometimes cause other, previously selected features to be unselected. We suggest that you simply turn off categorization and scroll to “Eclipse Help System” and select that feature.

Note — The Help UI requires the UI forms bundle (org.eclipse.ui.forms).  This is not part of the standard RCP feature and so typically would not be part of your target platform. We have added it manually in the provided target definition in the misc folder as a convenience. As an alternative, you could add the Eclipse Platform SDK feature from the Galileo repository to your target.  This includes UI forms, in addition to many other things, some of which you may find useful.

on Jun 18th, 2010Chapter 10 Errata

To make it easier to run the examples in standalone mode, we recommend running a local XMPP server and running the Eliza bot locally as you work through the examples. Here are the steps:

  1. Download the Openfire server, install, and run it.
  2. Using the admin web ui for Openfire, add 2 users: ‘eliza’ and ‘reader’. Set their respective passwords to ‘secret’.
  3. Load the sample code for Chapter 10 and select the ‘org.eclipsercp.eliza’ project and from the context menu click Run As > Eclipse Application. This will start eliza and from the Openfire admin ui you should see her as logged in now.
  4. The Eliza bot will now be part of the sample code for Chapters 10 and on.

From this point on, you can continue with the sample code an use your machine name (e.g., localhost) instead of ‘eclipsercp.org’ in all code that connects to the server.

on Jun 18th, 2010Forums enabled

Earlier today we enabled forums on the Eclipse RCP book site. This is a great place for readers to find out about issues with the text or the sample code as well as ask questions of the authors and other readers.

on Apr 13th, 2010Eclipse RCP 2nd Edition going to press!

We are very pleased to report that the long awaited 2nd edition of the Eclipse RCP book (http://eclipsercp.org) is going to the presses on Thursday, April 15th. That means it should be in the stores by the end of the month. Of course, you don’t have to wait, you can pre-order from Amazon or read it online at Safari. Check out the book website for more info.

In addition to the snazzy new cover, this book is an update of the original content to include new technologies, updated workflows and more detail. Here is the marketing blurb from the back cover…

In Eclipse Rich Client Platform, Second Edition, three Eclipse Rich Client Platform (RCP) project leaders show how to use Eclipse 3.5 (“Galileo”) to rapidly deliver cross-platform applications with rich, native-feel GUIs.

The authors fully reveal the power of Eclipse as a desktop application development platform; introduce important new improvements in Eclipse 3.5; and walk through developing a full-featured, branded RCP application for Windows, Linux, Mac, and other platforms—including handheld devices and kiosks.

Drawing on their extensive experience, the authors cover building, refining, and refactoring prototypes; customizing user interfaces; adding help and software management features; and building, branding, testing, and shipping finished software. They demonstrate current best practices for developing modular and dynamically extensible systems, using third-party code libraries, packaging applications for diverse environments, and much more.

For Java programmers at all levels of experience, this book

  • Introduces important new RCP features such as p2, Commands, and Databinding
  • Thoroughly covers key RCP-related technologies such as Equinox, SWT, JFace, and OSGi
  • Shows how to effectively brand and customize RCP application look-and-feel
  • Walks through user interface testing for RCP applications with SWTBot
  • Illuminates key similarities and differences between RCP and conventional plug-in development

Hands-on, pragmatic, and comprehensive, this book offers all the real-world, nontrivial code example working developers need—as well as “deep dives” into key technical areas that are essential to your success.