Eclipse RCP: What to do when things don’t work on your colleague’s machine

Juli 7th, 2009

I have compiled a list of potential pitfalls, that one might step in when executing code on another system:

  • Check your IDs
  • Check them again
  • Does your product contain all nessesary Plugins/Features
  • Does your run-configuration (the one generated by selecting Run on your product) contain all your plugins? Did you press Add required plugins
  • If you use features, check them! Are all plugins present?
  • Help system: If your help system does not show: Double check that the Plugin-Editor did not swallow your context definitions. They are often gone if I simply open the editor. Topics do not disappear…
  • Check if all help system dependencies are present in your run-configuration. Start by adding all *help*-plugins, continue with *jetty* and *servlet*. Then press Add required plugins. That should do the trick.
  • If you know of any other helpful tricks, please let me know!

Kategorien: Eclipse RCP, Entwicklung, Java | Keine Kommentare

Eclipse RCP: The dreaded Plugin ID

Juli 2nd, 2009

Hi all!

Apologies for not updating this blog lately.

As I want to talk a little bit about my experiences with Eclipse RCP, I think it is suitable if I tried to write in english. Perhaps this can be helpful for non-german speakers aswell, as information/documentation about E-RCP is a little sparse.

So… lately I had the chance to be a part of a Eclipse RCP project, which I greatly looked forward to! As I took a deep-dive into the concepts, I noticed that things work very differently compared to web-applications or even Swing applications.

In case you are interested, I mostly refered to 2 books, namely

Additionally there is one blog by a guy called Lars Vogel, which I appreciate very much! Thanks for the great effort Lars!

By now, our project has produced a niffty little prototype of the soon-to-be greatest RCP-application. Though none of our design decisions are written in stone yet (e.g. I am not sure whether we should use editors for our inputs or just views), I think/hope I have more or less understood the framework.

But there is at least one thing, that bothers me time and time again:

The ubiquitous Plugin ID. I cannot complain much about the basic concept: Of course a plugin has to have an unique identifier, and when you refer to a specific plugin, you have to use this Plugin ID. But again and again I have spent ages looking for some error/non-functional bits while finally noticing that I used the wrong ID.

So I could just end up blaming me. What I am missing though is some kind of assistance from the framework itself, saying “Man! You are looking for a plugin named this.is.wrong, but I only know the following plugins:” I think that would save us a lot of time.

Lately I was implementing context-sensitive help. But I could not figure out, why hitting f1 on a text field did not do anything. This blog then showed me, where to place a proper breakpoint to take a peek into the help-listener. It showed that the context-arrays where simply empty. So no context help could be seen. At least I saw that the keybinding worked. After debugging a few hours I was basically stuck. I made a few steps back and made a small sample project. At first I experienced the same issues… is Ganymede broken? I then realized that I did not provide the Plugin ID but the package name (which had a different case). I changed cases and voila it worked. Again I debugged to the help-listener and behold: The context array had one element.

What I am asking myself right now is: Why doesn’t Eclipse tell me that it does not register my context (or puts it somewhere only it knows). Life would be easier! :) It is seldom obvious to me what happens internally, when Eclipse executes a specific functionallity. At least I need an easier way to find places to debug to.

Perhaps I’m just missing some point…

Until then I only can repeat what the aforementioned books told me before:

BE  VERY CAREFULL WHEN YOU USE PLUGIN-IDS as there is no safety net!

Kategorien: Eclipse RCP, Entwicklung, Java | Schlagwörter:, , | 1 Kommentar