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.

Monday, August 25, 2008

Reloading the page in Java with GWT

I was looking for the possibility to reload the main page from within my GWT Java client code. After a while searching the GWT mailing list I found this pretty simple solution:

private class MyReloadButtonClickListener implements ClickListener {
  public native void onClick(Widget arg0) /*-{
    $wnd.location.reload();
 
}-*/;
}


Works perfectly!

Wednesday, August 13, 2008

Do you need Subversion 1.5 on your Ubuntu box?

Ubuntu 8.04 does not officially support Subversion 1.5. So what if you want to use it? The solution is simple: Go and check out the website: https://launchpad.net/~clazzes.org/+archive and add the listed two lines to your apt sources.list.
It simply works!

JSecurity seems promising

In a project I am currently working on we need to implement security (authentication and authorization). Reading this Sonatype blog entry I found out about JSecurity. I will give it a try. Although the lack of documentation is obvious its concept makes the framework very interesting.

Friday, June 20, 2008

Do you know all Java networking properties?

Just in case you are in need of setting a proxy host or declaring proxy exceptions in your JVM I find this site very useful:
http://java.sun.com/j2se/1.5.0/docs/guide/net/properties.html
It lists all existing Java networking properties.

Friday, June 13, 2008

Ever wanted to know the exact name of your installed Linux distribution?

Type this command into shell and find out what Linux distro you are using:
cat /etc/issue
It gives you something like this:
Ubuntu 8.04.1 \n \l
If you don't know the kernel you are running with try this one:
uname -a
It gives you something like this:
Linux machinename 2.6.24-19-generic #1 SMP Wed Jun 4 16:35:01 UTC 2008 i686 GNU/Linux

Thursday, June 12, 2008

Problems updating my Debian Distribution, or do you know MMAP?

I was recently trying to update my Debian (lenny/sid) distro and ran into some problems I never had so far:
When calling
apt-get update
I got the following error message:
E: Dynamic MMap ran out of room
E: Ein Fehler trat beim Bearbeiten von g++-4.2 auf (NewVersion1)
E: Problem with MergeList /var/lib/dpkg/status

After digging around I found a solution for my problem:
Increase the Cache Limit size of APT in /etc/apt/apt.conf like this:
APT::Cache-Limit 80000000;
Be careful not to set the size too high!

Wednesday, May 14, 2008

Mac OS X Look And Feel for Java

Besides the great looking Substance Look And Feel (see one of my previous posts) I found the Quaqua Look And Feel which really looks great if you want to provide Mac OS X feeling for Java applications.

Wednesday, April 02, 2008

Searching for Freeware WYSIWYG HTML Editors

Well, finally I am back online with my blog and website. I moved to another apartment and my server is located in my apartment. No DSL, no server :-(
Check out this site http://www.thefreecountry.com/webmaster/htmleditors.shtml#wysiwyg if you are in need of a free WYSIWYG HTML Editor.