Total Pageviews

Thursday, October 23, 2008

Important Eclipse shortcuts

Recently I switched from being an IntelliJ IDEA user to become an Eclipse user. Although Eclipse refactoring features are not as good as IDEAs I really, really like the Maven integration m2eclipse in Eclipse. Those guys from Sonatype do a fantastic job there.
Together with Nexus - which also is developed by Sonatype - it is a wonderful combination of working development tools.
And no, I do not work for Sonatype ;-)
Now back to what really puzzles me in Eclipse.... the shortcuts and some missing features. One of the really important features I heavily used in IDEA was "Go To Implementation". If you are working on an interface and you would like to know which classes implement this interface you select "Go To Implementation" and IDEA shows you all the implementations of that interface.
Unfortunately I really couldn't find this feature in Eclipse until I stumbled up on this blog entry. This entry almost saved my life as a developer ;-)
Okay, to make it short: The shortcut for "Go To Implementation" in Eclipse is "Ctrl-T" and not F3!
Here is a small summary of very important Eclipse shortcuts:
  • Using Interfaces if you want to see implementation press Ctrl–T and not F3.

  • Ctrl-O in a class definition brings up Quick Outline. Start typing a member name and hit return when it’s unambiguous.

  • Ctrl-F6 can be used to switch to the editors. The order of the editors is quite user friendly as most recently used on the top. Same way Ctrl-F7 to switch to Views and Ctrl-F8 for Perspective.
  • And maybe the most important one: Ctrl-Shift-L shows you a list of all possible shortcuts available in the current context.

Important Eclipse shortcuts

Recently I switched from being an IntelliJ IDEA user to become an Eclipse user. Although Eclipse refactoring features are not as good as IDEAs I really, really like the Maven integration m2eclipse in Eclipse. Those guys from Sonatype do a fantastic job there.
Together with Nexus - which also is developed by Sonatype - it is a wonderful combination of working development tools.
And no, I do not work for Sonatype ;-)
Now back to what really puzzles me in Eclipse.... the shortcuts and some missing features. One of the really important features I heavily used in IDEA was "Go To Implementation". If you are working on an interface and you would like to know which classes implement this interface you select "Go To Implementation" and IDEA shows you all the implementations of that interface.
Unfortunately I really couldn't find this feature in Eclipse until I stumbled up on this blog entry. This entry almost saved my life as a developer ;-)
Okay, to make it short: The shortcut for "Go To Implementation" in Eclipse is "Ctrl-T" and not F3!
Here is a small summary of very important Eclipse shortcuts:
  • Using Interfaces if you want to see implementation press Ctrl–T and not F3.

  • Ctrl-O in a class definition brings up Quick Outline. Start typing a member name and hit return when it’s unambiguous.

  • Ctrl-F6 can be used to switch to the editors. The order of the editors is quite user friendly as most recently used on the top. Same way Ctrl-F7 to switch to Views and Ctrl-F8 for Perspective.
  • And maybe the most important one: Ctrl-Shift-L shows you a list of all possible shortcuts available in the current context.

Thursday, October 16, 2008

Problem solved: Eclipse with Cypal Studio, m2eclipse running GWT Hosted Mode under Linux

I am developing a GWT application on my laptop which runs on Ubuntu 8.
I am using Eclipse 3.4 with the m2eclipse plugin (my project is built using Maven 2) and Cypal Studio as GWT plugin. So far, nothing fancy one should think.
But there are a few things to overcome with:
  1. When you import your Maven project using m2eclipse the web project containing the GWT code will not be configured correctly to work with Cypal Studio. I haven't figured out yet the reason why, but a workaround to this problem is to generate the eclipse project files for the web project by executing "mvn eclipse:eclipse" manually. Now you are able to add a working "Run configuration" for the GWT hosted mode in eclipse.
  2. I started the newly created "Run Configuration" and got an error message stating that a file called "libswt-pi-gtk-3235.so" was missing. So I copied that one from the installed GWT 1.5.2 distribution to my local maven repository into the directory $M2_REPOSITORY/com/google/gwt/gwt-dev/VERSION.
  3. Now, choosing "Run" one would expect to see a starting hosted mode browser (namely Mozilla Firefox). But the only thing I saw was an error message saying "** Unable to find a usable Mozilla install **". Hm, I had installed the latest GWT distribution (1.5.2) and I had configured the path correctly within the Cypal preferences. The dependencies for the web project were all correctly managed by m2eclipse. So what the hell was going wrong?
    Well it turns out to be a problem with the gwt-dev-1.5.2-linux.jar dependency and the way Cypal (or GWT) resolves dependencies.
    The gwt-dev-1.5.2-linux.jar was a dependency of my web project. So Cypal (or GWT) assumes to have a valid GWT distribution and therefore a runnable Mozilla Firefox installed in the directory $M2_REPOSITORY/com/google/gwt/gwt-dev/VERSION. That was obviously not the case.
    So I copied ALL *.so files and the file mozilla-hosted-browser.conf from the GWT distribution directory to the $M2_REPOSITORY/com/google/gwt/gwt-dev/VERSION folder.
  4. The last thing was to edit the mozilla-hosted-browser.conf file and point to the mozilla-firefox installation of the GWT distribution. I did this using absolut path arguments (eg. /usr/local/share/gwt/gwt-1.5.2/mozilla-1.7.12).
  5. Now Cypal starts the GWT Hosted mode with the Mozilla Firefox browser.
I am aware of the fact that this is not the best solution. Poluting the maven directory with shared object files of the GWT distribution is somehow weird. But so far this is the only working scenario I have successfully configured and running with.
If you have a better solution don't hesitate to comment on this entry.

Problem solved: Eclipse with Cypal Studio, m2eclipse running GWT Hosted Mode under Linux

I am developing a GWT application on my laptop which runs on Ubuntu 8.
I am using Eclipse 3.4 with the m2eclipse plugin (my project is built using Maven 2) and Cypal Studio as GWT plugin. So far, nothing fancy one should think.
But there are a few things to overcome with:
  1. When you import your Maven project using m2eclipse the web project containing the GWT code will not be configured correctly to work with Cypal Studio. I haven't figured out yet the reason why, but a workaround to this problem is to generate the eclipse project files for the web project by executing "mvn eclipse:eclipse" manually. Now you are able to add a working "Run configuration" for the GWT hosted mode in eclipse.
  2. I started the newly created "Run Configuration" and got an error message stating that a file called "libswt-pi-gtk-3235.so" was missing. So I copied that one from the installed GWT 1.5.2 distribution to my local maven repository into the directory $M2_REPOSITORY/com/google/gwt/gwt-dev/VERSION.
  3. Now, choosing "Run" one would expect to see a starting hosted mode browser (namely Mozilla Firefox). But the only thing I saw was an error message saying "** Unable to find a usable Mozilla install **". Hm, I had installed the latest GWT distribution (1.5.2) and I had configured the path correctly within the Cypal preferences. The dependencies for the web project were all correctly managed by m2eclipse. So what the hell was going wrong?
    Well it turns out to be a problem with the gwt-dev-1.5.2-linux.jar dependency and the way Cypal (or GWT) resolves dependencies.
    The gwt-dev-1.5.2-linux.jar was a dependency of my web project. So Cypal (or GWT) assumes to have a valid GWT distribution and therefore a runnable Mozilla Firefox installed in the directory $M2_REPOSITORY/com/google/gwt/gwt-dev/VERSION. That was obviously not the case.
    So I copied ALL *.so files and the file mozilla-hosted-browser.conf from the GWT distribution directory to the $M2_REPOSITORY/com/google/gwt/gwt-dev/VERSION folder.
  4. The last thing was to edit the mozilla-hosted-browser.conf file and point to the mozilla-firefox installation of the GWT distribution. I did this using absolut path arguments (eg. /usr/local/share/gwt/gwt-1.5.2/mozilla-1.7.12).
  5. Now Cypal starts the GWT Hosted mode with the Mozilla Firefox browser.
I am aware of the fact that this is not the best solution. Poluting the maven directory with shared object files of the GWT distribution is somehow weird. But so far this is the only working scenario I have successfully configured and running with.
If you have a better solution don't hesitate to comment on this entry.