Using AspectJ in Ecplipse RCP

If you try to export an AspectJ enabled Eclipse RCP 3.6, you will notice that none of your pretty aspects is compiled.
Before Eclipse 3.6 there was an export option as “Export Product with AspectJ”.

But since version 3.6 you will not see that option. Instead you should just add AspectJ compiler adapter into your build.properties file:

compilerAdapter = org.eclipse.ajdt.core.ant.AJDT_AjcCompilerAdapter
sourceFileExtensions = *.java, *.aj

Migrated from old blog: using-aspectj-in-eclipse-rcp

JFreeChart in Eclipse RCP & SWT

To use JFreeChart in a Eclipse RCP project or simply embed in an SWT composite, you have two applicable choices:
org.jfree.experimental.chart.swt.ChartComposite from JFreeChart SWT experimental project, which I can not say works seamless.

SWT_AWT bridge, hmm, not perfect but plays its role better.

  • Create a container composite with SWT.EMBEDED style (required for SWT_AWT).
Composite container = new Composite(parent, SWT.EMBEDDED)
  • Create new AWT Frame using container.
java.awt.Frame chartFrame = SWT_AWT.new_Frame(container)
  • Create a JFreeChart ChartPanel and append on chartFrame. (This should be done in AWT Event Thread)
SwingUtilities.invokeLater(new Runnable() {
     public void run() {
          ChartPanel chartPanel = new ChartPanel(chart, true);
          chartFrame.add(chartPanel);
     }
})

That’s it!

Migrated from old blog: jfreechart-in-eclipse-rcp-swt

Install JDK 5 on Snow Leopard

Download Leoapard (Mac OS X 10.5) JDK from here

Extract gzip archive.
tar -xvzf java.1.5.0-leopard.tar.gz

Move extracted folder to java framework installation folder. You need to do this as root user.
sudo mv 1.5.0 /System/Library/Frameworks/JavaVM.f…