Archive for May, 2009

Eclipse 3.5 RC3 released : Cocoa works great

May 31st, 2009

Eclipse 3.5 RC3 is out and this release fixes the last issues (Bugs 277539 and 277437) I was seeing when running the best test suite I have, ShareMedia, on the previous 3.5 RC2 Cocoa x86_64 SWT port.

Now everything is working, even the most tricky parts such as custom widgets, Open GL with LWJGL and animations…. :-)

ShareMedia running on SWT 3.5 Cocoa x86_64

ShareMedia running on SWT 3.5 Cocoa x86_64

The new 3.5 release also brings some long-waited features on Mac OS X :

- Java 6 and 64 bits support

- Shell modified hint

Shell modified hint

Shell modified hint

- Shell sheet style

Shell sheet style

Shell sheet style

- Program icons are now returned in full size !!!! Program.findProgram("jpg").getImageData() returns beautiful 512×512 icons instead of 16×16, see the following gallery widget snippet :

Gallery Snippet on SWT 3.4

Gallery Snippet on SWT 3.4

Gallery Snippet on SWT 3.5

Gallery Snippet on SWT 3.5

UPDATE: Oh no ! this is a cocoa bug, images should still be returned in 16×16. SWT committers, please don’t fix it ! :-) I hope this will help fixing bug 181723.

These improvements make Eclipse 3.5 an absolute must for all Mac users.

The only thing I’m still missing is the Native OSX toolbar (bug 222859)

I would like to thanks all developpers who worked very hard to create this great Cocoa port in only one year and those who keep hacking to improving Eclipse UI on Mac.

Building RCP plugins or products with Maven2

May 29th, 2009

This is something I never really took the time to try.

At first this seems rather complicated because of the duplication of dependencies in both pom.xml and MANIFEST.MF and because RCP plugins are usually not deployed to maven public repositiories.

Tycho now seems the way to go but I’m looking for advices from my readers.

How do you build RCP products with maven2 ?

Leopard update

May 16th, 2009

Updated to MacOX 10.5.7. No issues so far… :-)

wget on Solaris 10

May 13th, 2009

wget is not in $PATH by default on Solaris 10. You’ll find it in /usr/sfw/bin/

Apache Lucene sort tips

May 12th, 2009

The default search implementation of Apache Lucene returns results sorted by score (the most relevant result first), then by id (the oldest result first).

This behavior can be customized at query time with an additionnal Sort parameter .

TopFieldDocs Searcher#search(Query query, Filter filter, int n, Sort sort)

The Sort parameter specifies the fields or properties used for sorting. The default implementation is defined this way :

new Sort(new SortField[] { SortField.FIELD_SCORE, SortField.FIELD_DOC });

To change sorting, you just have to replace fields with the ones you want :

new Sort(new SortField[] {
SortField.FIELD_SCORE,
new SortField("field_1", SortField.STRING),
new SortField("field_2", SortField.STRING) });

This sounds simple, but will not work until the following conditions are met :

  • You have to specify the type parameter of SortField(String field, int type) to make Lucene find your field, even if this is normaly optional.
  • The sort fields must be indexed but not tokenized :

    document.add (new Field ("byNumber", Integer.toString(x), Field.Store.NO, Field.Index.NOT_ANALYZED));

  • The sort fields content must be plain text only. If only one single element has a special character or accent in one of the fields used for sorting, the whole search will return unsorted results.