Layout Image
  • Home
  • RCP Training
  • OSGi Training
  • Contact

Renaming Eclipse RCP – Final results

by Patrick
September 9th, 2009

iStock_000008699441XSmallWell the results of the survey are in, and the clear favorite is the existing name: Eclipse RCP. While the original purpose of the survey was to create a short-list of names, I think the strong showing of the existing name means that the process should stop here. So long live Eclipse RCP!

For those of you interested in a summary of the results, 472 people took the survey (which is pretty good, I think). The top 5 name were:

  1. Eclipse RCP – 169 votes
  2. Eclipse Platform – 51 votes
  3. Aurora – 48 votes
  4. Corona – 38 votes
  5. Tangram – 32 votes

There were also many write-in votes, some of which were kind of amusing:

  1. Colbert (only 2 votes, sorry Stephen!)
  2. AlBlue’s Big Bundle of Fun
  3. Twilight

On a more serious note, I’d like to thank everyone who took the survey and all of those who expressed their opinion both publicly and privately. One of the great things about open-source software is that we are able to make decisions as a community, and I think this process has been a good example of that.

DZoneLinkedInDeliciousDiggEvernoteFacebookFriendFeedGoogle BookmarksRedditSquidooStumbleUponTechnorati FavoritesTwitterYahoo BookmarksShare/Save
Categories Announcement, eclipse, Rich Client Platform
Comments (8)

Managing Eclipse RCP launch arguments

by Patrick
September 8th, 2009

In my last post I discussed how to best manage run configurations for Eclipse RCP applications. But there was one related topic I wanted to discuss in more detail, and that is how to manage launch arguments.

What are launch arguments?

Launch arguments are arguments that are added to the command line when you execute your application. These arguments come in two flavors:

  • Program arguments – Arguments that are Eclipse-specific. For example, the -clean argument will clear the configuration area on startup.
  • VM arguments – Arguments that make sense to the Java VM. For example, the -Xmx argument allows you to set the maximum heap size for the VM.

Both of these argument types can be set on the Arguments tab in the Run Configurations dialog.
launch-arguments-1

Launch arguments and the target platform

We oftentimes want to apply the same launch arguments to all of our run configurations, and one way to handle that is to specify them on your target platform. On the Target Platform preference page there is a section where you can add whatever arguments you wish.
launch-arguments-2
The arguments associated with a target platform will be added to run configurations generated from the Manifest Editor. They will not be added to configurations generated by the Product Configuration Editor. Also, because the Manifest Editor link does not regenerate a configuration each time, you will need to explicitly delete a configuration if you want to recreate it using new target platform arguments.

Launch arguments and products

A second way to manage arguments is to add them using the Launching tab of the Product Configuration Editor.
launch-arguments-3
When you add arguments in this way, two things will happen:

  1. The arguments will be added to your run configurations if you launch using the link in the Product Configuration Editor. Because this link regenerates the run configuration each time, consistent use of the link guarantees that your configuration is in synch with your product definition.
  2. The arguments will also be added to your deployed application in the form of an INI file. This is a nice feature, but it means that you need to be careful when adding arguments that are only useful during development. For example, you may want to use -clean to clear the configuration area when you’re developing, but you probably do not want to ship this argument to your customers.

Launch arguments best practices

My approach is to add arguments using the Product Configuration Editor and to always launch my applications using the link in that editor. This guarantees that my run configurations are always in synch with my product definition. I also take care to not add arguments that would be detrimental to a deployed application. Some, such as -consoleLog, I consider harmless in a deployed app and I just leave those in.

If for some reason I absolutely have to add an argument that should not be deployed, I usually clean it out of the INI file during the build process. It’s pretty rare for me to have to do this, though.

DZoneLinkedInDeliciousDiggEvernoteFacebookFriendFeedGoogle BookmarksRedditSquidooStumbleUponTechnorati FavoritesTwitterYahoo BookmarksShare/Save
Categories Configuration, eclipse, Rich Client Platform, Tips
Comments (2)

Renaming Eclipse RCP – only 3 days left to vote!

by Patrick
September 3rd, 2009

imagesThe poll to help select a new name for Eclipse RCP will wrap up on September 6th, so make your voice heard and vote today!

For more information on the purpose of the poll, as well as to see my picks, check out the initial announcement.

Note: You can view the survey results online.

DZoneLinkedInDeliciousDiggEvernoteFacebookFriendFeedGoogle BookmarksRedditSquidooStumbleUponTechnorati FavoritesTwitterYahoo BookmarksShare/Save
Categories Announcement, eclipse, Rich Client Platform
Comments (0)

Run Configurations and Eclipse RCP

by Patrick
September 3rd, 2009

When developing Eclipse RCP applications we execute our code in the IDE using a run configuration. A run configuration is basically a collection of properties that defines how our application should be run, and these properties include:

  1. What application or product to launch, specified by id
  2. Which bundles to make available at runtime
  3. What program (Eclipse-specific) or VM arguments to use

And while run configurations are relatively straightforward, there can be some confusion about how to create and manage them. Hopefully this post will help.

Creating a run configuration

There are three ways to create a run configuration:

  1. By hand (yuck!)
  2. Clicking the Launch an Eclipse application link on the Overview tab of the Manifest Editor.
  3. Clicking the Launch an Eclipse application link on the Overview tab of the Product Configuration Editor.

Let’s ignore creating a run configuration by hand. If you prefer that approach, more power to you! But most of us find it easier to generate run configurations by clicking the editor links mentioned above.

Where some confusion arises is that the two editors in question generate run configurations in different ways. Let’s look at each editor in turn.

Creating a run configuration with the Manifest Editor

It’s possible to generate a run configuration by clicking on the Launch an Eclipse application link in the Testing section of the Manifest Editor. We can also accomplish this by clicking the equivalent toolbar button. Both options are highlighted by the red squares in the image below.
manifest-run-config
But what really happens when you click the link or button? Behind the scenes, the following logic is performed:

  1. The bundle associated with the manifest being edited is searched for an application or product extension. If one is found, that extension will be used when creating the run configuration.
  2. The current run configurations are searched, and if an existing configuration exists for the particular application or product id, then that configuration will simply be reused.
  3. If no matching run configuration is found, then a new one will be created. The available bundle list is created by traversing the dependency graph for the bundle associated with the manifest being edited. The arguments are taken from the current target platform for the workspace.

And what happens if you launch from a bundle that does not contain an application or product? Then the application will be set to Eclipse itself and a new instance of Eclipse will be launched with your bundles added into the mix.

This can be a source of great confusion for Eclipse RCP developers, and this is one reason that I discourage use of the Manifest Editor to create run configurations. On the other hand, it’s usually obvious if you’ve selected the wrong manifest. Your first tip that something is amiss will be the appearance of the Eclipse splash screen. If you’re not seeing your own splash screen, you’ve probably launched from the wrong manifest.

Creating a run configuration with the Product Configuration Editor

Because it’s very easy to create incorrect run configurations using the Manifest Editor, I usually suggest that developers use the Product Configuration Editor instead. The options look very similar in this editor (unfortunately at times they look too similar), and you can see them highlighted in red below.
product-run-config
But while the options look similar in both editors, there are slight differences in behavior. Specifically, the Product Configuration Editor uses the following logic:

  1. First, a new run configuration is always generated. No attempt is made to search existing run configurations for a match, and if one already exists it will be overwritten. This can be particularly important if you’ve made manual changes to your run configurations.
  2. The product id will obviously be taken from the product configuration file, as will the available bundles (Dependencies tab) and arguments (Launching tab). Note that arguments associated with your target platform are not used in this case.

What is the best approach?

As you’ve probably surmised, I suggest using the Product Configuration to create run configurations. Here are the two biggest reasons:

  • It’s easier to make a mistake with the Manifest Editor by selecting a manifest in the wrong bundle.
  • Using the bundle list generated by a product configuration ensures the same bundles will be built into your deployed application. When using the Manifest Editor, it’s very easy to get into a situation where your app works in the IDE, but not after it is built and deployed.

As an aside, it’s possible to generate your run configuration from the Product Configuration Editor and then run it later by clicking the Run button in the main toolbar or selecting it in the Run Configurations dialog. This will obviously not cause your existing configuration to get overwritten.

I choose not to do this because I prefer to treat my product configuration as the only real location for runtime properties. I’ll come back to this issue in a subsequent post, as this discussion has gone a bit long!

DZoneLinkedInDeliciousDiggEvernoteFacebookFriendFeedGoogle BookmarksRedditSquidooStumbleUponTechnorati FavoritesTwitterYahoo BookmarksShare/Save
Categories Configuration, eclipse, Rich Client Platform, Tips
Comments (0)

Creating an Eclipse RCP target platform

by Patrick
September 1st, 2009

The PDE team has given RCP developers some great new features in Eclipse 3.5. It’s now much easier to create and manage target platforms for Eclipse RCP applications. In this post, I’ll outline one simple workflow that should work in most cases.

But first, if you’re interested in what a target platform is or why you might want to create one, check out these previous posts.

  • Why create a target platform?
  • RCP target platform tips

So now that you understand why we should create a target platform, what’s the best way to do it?

Create a target definition file

Eclipse target platforms can be created and selected directly in the Target Platform preferences page, but a better approach is to define your target platform using a target definition file. A target definition file outlines what should be included in your target platform and where the features and bundles can be located. More importantly, target definition files can be checked in to your version control repository and shared among the members of your team.

So how do we create one? You see here a sample RCP application that was generated with the Hello World template. Let’s add a target definition to this project.
sample-project

Right-click on the project name and select New > Other. Then choose Plug-in Development > Target Definition in the wizard selection dialog.
new-target-definition
The wizard page prompts you to select a file name, and I’m going to choose samplercp.target to match my project name. Remember, it’s a good idea to have a separate target platform for each project you work on.

Define your target platform

Now that we have a target definition file in our project, we can select what to include in our target platform. We do that by identifying one or more locations that may contain features or bundles. Eclipse 3.5 supports four types of locations (directories, installations, features, and software sites).

In this workflow, I’ll be using a software site which means that the features and bundles will be downloaded from a repository and stored locally under my workspace .metadata folder.

For an RCP application, we typically want to set our target platform to the Eclipse RCP SDK which is made up of two features:

  • org.eclipse.rcp
  • org.eclipse.rcp.source

Let’s add these features to our target platform. Start by clicking Add in the Target Definition Editor (this editor should have opened automatically after you created the target definition file). Then select Software Site on the Add Content dialog and click Next.
target-platform-add-content
The next page of the wizard is where the real work is done. We’re going to specify a repository location where the Eclipse RCP SDK can be retrieved.

  • First, select the Galileo repository from the Work with drop-down.
  • Next, deselect the Group by Category checkbox. For some reason, the Eclipse RCP SDK does not appear anywhere in the category listing. You would think it would be included under the EclipseRT Target Platform Components category, but no such luck.
  • Finally, place a check next to the Eclipse RCP SDK entry in the list and click Finish

target-platform-add-content2
As soon as you click finish, Eclipse PDE will start the process of downloading the RCP SDK to your machine. Your target definition file should look like this:
target-defintion-complete

Activate your new target platform

The final step is to activate your target platform by clicking the Set as Target Platform link in the upper-right corner of the Target Definition Editor. Then you’re all set! And make sure to check in your target definition so everyone on your team can share the fruits of your hard work ;-)

DZoneLinkedInDeliciousDiggEvernoteFacebookFriendFeedGoogle BookmarksRedditSquidooStumbleUponTechnorati FavoritesTwitterYahoo BookmarksShare/Save
Categories eclipse, Rich Client Platform, Tips
Comments (15)

What is a modular application, anyway?

by Patrick
August 27th, 2009

Drop of waterWhat does the term application mean in the context of modular software development (and OSGi in particular). It seems to me that the concept of an application starts to break down. For instance, is an OSGi application just the set of bundles known to the framework?

Well, here’s my take on what a modular application might mean.

Going beyond the steady state

When an OSGi framework fires up, some bundles may be activated, others may not. Some activators may perform logic, others may not. But what arises from this activity? Is this the equivalent of launching an application? It can be, but its more often the case that the framework arrives at a steady state, waiting for an input that triggers some behavior.

This can be confusing when we start using OSGi because this doesn’t look like an application. What we need is an entry point. Just as throwing a rock into a pond causes waves to form, we need to launch a thread of execution that takes us beyond the steady state. So how do we accomplish this?

Eclipse applications

The Eclipse platform provides us with one answer in the form of an Eclipse application. An Eclipse application is defined through the org.eclipse.core.runtime.applications extension point and is represented by an IApplication instance at runtime. And this mechanism can easily be added to Equinox by installing some additional bundles.

This is how, for example, Eclipse RCP applications are launched in the context of an OSGi framework. But it’s interesting to note that one set of bundles may support multiple applications. So a good way to look at an application is that it is merely a specific entry point into the functionality provided by a community of bundles.

The OSGi Application Admin service

We can take the concept of an OSGi application one step further by utilizing the OSGi Application Admin service. This service recognizes the concept of an application in the abstract (specific providers can define what an application means in each case), and allows an application to provide an entry point that will launch a thread of execution.

Equinox, for instance, provides an application descriptor for Eclipse applications. This means that you can use the Application Admin service to start and stop Eclipse applications from the OSGi console. The available console commands are:

  • apps – list currently available applications
  • activeApps – list currently active applications
  • startApp [app id] – start an application
  • stopApp [app id] – stop an application

These commands can be used to launch most types of Eclipse applications, including those with an SWT user interface. Unfortunately, they cannot yet be used to launch Eclipse RCP applications because of the way in which singletons are used. This is scheduled to be fixed as part of the e4 work.

Possibilities

I think all of this is pretty exciting because it allows us to reimagine the relationship between applications, modules and running platforms (JVMs and OSGi frameworks). For example, imagine being able to deploy an Eclipse RCP application into a running OSGi-based ESB. The application would allow you to manipulate the ESB in container and it could then be undeployed when no longer needed. All of this could be done without restarting the ESB.

It’s going to be fascinating to see how of all this plays out in the next few years. The possibilities are endless!

DZoneLinkedInDeliciousDiggEvernoteFacebookFriendFeedGoogle BookmarksRedditSquidooStumbleUponTechnorati FavoritesTwitterYahoo BookmarksShare/Save
Categories eclipse, OSGi, Rich Client Platform
Comments (1)

Renaming Eclipse RCP – Vote now!

by Patrick
August 24th, 2009

imagesIt’s been three months since my post requesting that we rename Eclipse RCP and we’ve received many ideas from the Eclipse community. Now it’s time to narrow down the list by voting for the names you like best.

I want to make it clear that while this poll will help to narrow down the list, it will not wholly determine the final selection. This is because trademark issues may need to be considered as well.

I also want to share the names I voted for and why. The poll allows you to select up to three names, so here are the name I chose:

Montage

I want the new name for Eclipse RCP to emphasize the fact that it is a platform for creating modular user interfaces. The term montage means:

the technique of combining in a single composition pictorial elements from various sources (full definition here)

Montage combines the concept of visualness with an emphasis on assembly from parts. This seems to me to convey something of what this platform provides, especially when you consider that the e4 work will allow developers to combine UI elements created with Java, Javascript and HTML in a single workbench.

Tangram

Another name I really like is Tangram, which is a Chinese puzzle based on assembling pictures from basic shapes. This name also conveys the idea of assembling a user interface from component parts.

One benefit of the name Tangram is that it provides great graphic art options in terms of logos, book cover designs, etc.

Aurora

My final selection is a more traditional astronomy-related name. There are many such names in the list, but I think aurora is the simplest and cleanest. It has a visual connotation (but does not express modularity). If there is a strong consensus that the name should relate to the overall Eclipse emphasis on astronomy, then this is my choice.

My final selection?

So what name do I really want? My top two are Montage and Tangram, and it’s hard for me to pick one or the other. I guess if I had to pick one it would be Tangram, but it’s really close.

Now it’s your turn

Now it’s your turn to vote. Click on the link below to select your three favorite names, and while you’re at it why not blog (or tweet) about your choices. I’m curious to hear what people think is important in a name. The poll will remain up for the next two weeks (until September 6th) to give as many people as possible a chance to vote.

Click here to vote!

Note: You can view the survey results online.

DZoneLinkedInDeliciousDiggEvernoteFacebookFriendFeedGoogle BookmarksRedditSquidooStumbleUponTechnorati FavoritesTwitterYahoo BookmarksShare/Save
Categories Announcement
Comments (0)

Software is like a bowl full of jello

by Patrick
August 21st, 2009

bowl-of-jelloIt’s Friday afternoon and I’m in a contemplative mood. For some reason, I’ve been thinking about my first manager, who I wasn’t very fond of at the time. I’m sure I was a real pain in his backside as well, being a fresh-out-of-college know-it-all.

One of the things that drove me nuts about him was the way he mangled metaphors and sayings. He liked to tell me “never put the horse before the cart” and stuff like that. But one saying he used will always stick with me. He’d say:

Patrick, software is like a bowl full of jello. And our job is to get our arms around that bowl!

I remember thinking that I’d rather not get my arms around a bowl full of jello. What good would that do? It would still be a bowl full of jello, and I’ve never liked jello anyway. But what also struck me at the time was that this really is what software is like to people who don’t leverage information hiding. Spaghetti is almost too clean a metaphor (at least you can pull out some noodles if you want). Jello really captures the nasty, sticky grossness of badly encapsulated software.

Even though I didn’t like this manager at the time, he did inadvertently start me down the path to software modularity. Hopefully by focusing on modularity, we can stop dealing with bowls of jello and at least work with jello shots :-)
jello-shots

DZoneLinkedInDeliciousDiggEvernoteFacebookFriendFeedGoogle BookmarksRedditSquidooStumbleUponTechnorati FavoritesTwitterYahoo BookmarksShare/Save
Categories eclipse, Ramblings
Comments (0)

Adding Eclipse IDE menu options to your RCP applications

by Patrick
August 17th, 2009

Note: The post below is actually incorrect, which is a good thing in my opinion. It is indeed possible to use the command framework to add the standard Eclipse IDE menu options. Rather than take down the post, which I think is unethical, please read the post and then the note at the end for clarification.

One of the many things that Eclipse RCP provides is a set of standard menu options that are used by the Eclipse IDE itself. These include standard menu options such as Exit, Save, Cut/Copy/Paste, but also workbench specific options such as Reset Perspective and Show Views.

In short, almost all of the menu options you see in the Eclipse IDE are available for use in your RCP applications. And I tell most teams starting out with Eclipse RCP to go through the Eclipse IDE menu and make a list of those options that make sense for their application.

So how can we add these menu options to our applications?

Using actions

Traditionally, Eclipse IDE menu options have been added as actions in the ActionBarAdvisor. The Eclipse actions can be referenced as constants in the ActionFactory class, and adding a menu option looks like this:

IAction saveAction = ActionFactory.SAVE.create(window);
fileMenu.add(saveAction)

Using commands

During the last few years, most Eclipse RCP developers have transitioned from actions to commands. Commands, and their associated handlers and menus, provide a clean separation between UI and non-UI concerns. As part of the transition to commands, Eclipse RCP now provides us with the Eclipse IDE menu options as a set of extensions defined in the org.eclipse.ui bundle.

command-extensions

The commands point to handlers that implement the behavior associated with menu options. We could, if we like, create org.eclipse.ui.menus extensions that refer directly to these commands. This would allow us to define our entire menu using declarative syntax.

Which approach should we use?

So the question is, should we choose the command-based approach? The answer (for Eclipse IDE menu options only) is no. Using the org.eclipse.ui.menus extension point to add Eclipse IDE menu options is problematic in that we lose access to look and feel attributes. Specifically, the ActionFactory constants provide us with the following menu attributes:

  • label
  • tooltip
  • image (enabled and disabled)
  • help context

Not only that, but the actions provide us with these values as externalized strings with support for internationalization. So while actions are really the old way of doing things, the ActionFactory/ActionBarAdvisor combo is still the preferred way of utilizing Eclipse IDE menu options.

When should I use commands?

Well you should definitely be using the command-based approach for your own menu options. Also the Eclipse IDE commands are still useful if you want to link your own menu options to them. You may want to reference the standard Eclipse IDE options in view menus, cheat sheets, dialogs, etc.

Finally, you should know that the actions produced by the ActionFactory are actually bridged to commands and handlers behind the scenes. This means that even though you are using actions to define the menu options, you can still provide your own handlers for them.

Clarification: What I missed when writing this post was that the Eclipse IDE commands contain localized text which will show up in your menu if you leave the menu label blank. Also, images will appear in the menu, and these are contributed via the org.eclipse.ui.commandImages extension point.

I’m still not clear on how tooltips or help contexts are handled, but you can get almost all the way there with the command framework. So in my opinion, the best practice for new Eclipse RCP applications would be to use the command framework for all menu options and discontinue usage of the ActionBarAdvisor.

Thanks to Lars Vogel for the correction!

Clarification #2: Having looked into this further, it appears that some of the standard Eclipse IDE menu options require that the ActionFactory action be created and registered before the commands will work. You don’t actually need to use the actions to create the menu options in the ActionBarAdvisor, though. For more information on this, see this Bugzilla entry.

DZoneLinkedInDeliciousDiggEvernoteFacebookFriendFeedGoogle BookmarksRedditSquidooStumbleUponTechnorati FavoritesTwitterYahoo BookmarksShare/Save
Categories eclipse, Rich Client Platform, Tips
Comments (10)

Book Review: Practical Eclipse Rich Client Platform Projects

by Patrick
August 13th, 2009

There aren’t many books available about the Eclipse Rich Client Platform. One reason for this, I think, is that it’s a difficult subject to cover effectively. Eclipse RCP is less a coherent framework than an aggregation of related technologies, and this can make it difficult to describe. As someone who has worked hard to craft clear Eclipse RCP training materials over the last few years, I sympathize with anyone who takes up the challenge.

And taking up this challenge is Vladimir Silva in his book Practical Eclipse Rich Client Platform Projects. I hadn’t heard much about this book, and only found about it when browsing the book table at last year’s EclipseCon. This summer I’ve finally found the time to read it and here is my review.

A good start

The first thing I like about the book is that it’s short. At a mere 335 pages, the book invites you to actually read it, not just treat it as reference material. I have a bias towards shorter technical books in general, as it shows a bit of self-discipline and thoughtfulness. The books produced by Pragmatic Programmers are a great example of this.

I also like the way the book starts, with a focus on OSGi. It’s essential that RCP developers learn from the start that OSGi and modularity are at the heart of the platform. Everything seems to click faster for developers when they understand some OSGi basics.

A strange mix

So far so good, but what is the rest of the book like? The word I’d use is odd. Any shorter technical book has to make tough choices about what to include, but the choices made by this author left me scratching my head a bit.

The first three chapters provide a pretty thin introduction to the structure of an RCP application. Topics covered include the workbench, editors, views, menus, commands, handlers and product branding. But all of these topics are covered extremely briefly and in my opinion do not add a lot to what can be found in the Eclipse help system.

After that, the book gets more interesting, but in an odd way. The author takes us on some deep dives into an eclectic mix of advanced topics (with the exception of a chapter on the help system). These topics include:

  • Common Navigator Framework
  • 2D graphics with GEF and ZEST
  • 3D graphics for RCP with OpenGL
  • BIRT
  • Automatic updates

These topics are covered in various levels of detail. The chapter on OpenGL, for instance, is as long as all of the RCP chapters combined!

My initial reaction to this content is that if you’re interested in some of these topics, then this book is worth buying. There is very little published content on topics such as CNF and Zest. But in the end, I think these these topics are only tangentially related to Eclipse RCP itself.

Final thoughts

There are so few books on Eclipse RCP that any book at all is a welcome addition. And I applaud the author for covering some topics that have received so little attention in the past.

My overall recommendation is that if you’re looking for a solid introduction to Eclipse RCP, this book is not really for you. My suggestion would be to pick up Eclipse Plug-ins, which covers the core Eclipse RCP APIs much more thoroughly.

On the other hand, if you’re an Eclipse RCP developer interested in one or more of the topics covered in later chapters, definitely have a look.

DZoneLinkedInDeliciousDiggEvernoteFacebookFriendFeedGoogle BookmarksRedditSquidooStumbleUponTechnorati FavoritesTwitterYahoo BookmarksShare/Save
Categories eclipse, review, Rich Client Platform
Comments (4)
« Previous Page
Next Page »

Want to know more about RCP training?

Get information on private training options, pricing, availability and references.

Email address

Want to learn RCP online?

There are still spots available in the next online RCP Quickstart course being held February 27 - 29.

About me

Patrick Paulin

Patrick Paulin is a software developer and trainer specializing in modular technologies such as OSGi and the Eclipse Rich Client Platform.

Patrick lives in Madison, Wisconsin with his wife and two daughters.

Email - patrick at modumind dot com

Modular Mind
Copyright © 2012 All Rights Reserved
iThemes Builder by iThemes
Powered by WordPress