Since Databinding is a 3.2 fe3 feature, and many forms enhancements were made in 3.3 too, it is recommended to use Eclipse 3.3 if at any way possible.
IIf there is no possible way, you can use the Eclipse 3.2 backport. It brings a special patched ve backport of Eclipse databinding, which will even support emf databinding.
It is maintained in a branch 320_backport in the repository. Check it out, compile against Eclipse 3.2 and run the examples.
Be aware, that the examples only run when the swt native dlls (windows) are contained in the library path, e.g. add something like this to your vm arguments:
-Djava.library.path=d:\develop\swt320libs
Eclipse >= 3.3 automatically sets a default realm when starting the workbench. Eclipse 3.2 does not know databinding, thus it does not. You need to add code to do this, e.g. in the main method of your rcp application; if you use feature or plugins, you need to set the real early in the startup process or wrap all binding calls into a runnable and start it with Realm.runWithDefault().
Patch for org.eclipse.core.databinding:
Index: src/org/eclipse/core/internal/databinding/Activator.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/Activator.java,v retrieving revision 1.2 diff -u -r1.2 Activator.java --- src/org/eclipse/core/internal/databinding/Activator.java 11 Apr 2008 22:18:08 -0000 1.2 +++ src/org/eclipse/core/internal/databinding/Activator.java 8 Apr 2009 10:26:50 -0000 @@ -11,29 +11,16 @@ package org.eclipse.core.internal.databinding; -import java.util.ArrayList; - -import org.eclipse.core.databinding.util.ILogger; -import org.eclipse.core.databinding.util.Policy; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.osgi.framework.log.FrameworkLog; -import org.eclipse.osgi.framework.log.FrameworkLogEntry; -import org.osgi.framework.BundleActivator; +import org.eclipse.core.runtime.Plugin; import org.osgi.framework.BundleContext; -import org.osgi.util.tracker.ServiceTracker; /** - * @since 3.3 - * + * The activator class controls the plug-in life cycle */ -public class Activator implements BundleActivator { - /** - * The plug-in ID - */ - public static final String PLUGIN_ID = "org.eclipse.core.databinding"; //$NON-NLS-1$ +public class Activator extends Plugin { - private volatile static ServiceTracker _frameworkLogTracker; + // The shared instance + private static Activator plugin; /** * The constructor @@ -41,62 +28,37 @@ public Activator() { } + /* + * (non-Javadoc) + * + * @see + * org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext + * ) + */ public void start(BundleContext context) throws Exception { - _frameworkLogTracker = new ServiceTracker(context, FrameworkLog.class.getName(), null); - _frameworkLogTracker.open(); - - Policy.setLog(new ILogger() { - - public void log(IStatus status) { - ServiceTracker frameworkLogTracker = _frameworkLogTracker; - FrameworkLog log = frameworkLogTracker == null ? null : (FrameworkLog) frameworkLogTracker.getService(); - if (log != null) { - log.log(createLogEntry(status)); - } else { - // fall back to System.err - System.err.println(status.getPlugin() + " - " + status.getCode() + " - " + status.getMessage()); //$NON-NLS-1$//$NON-NLS-2$ - if( status.getException() != null ) { - status.getException().printStackTrace(System.err); - } - } - } - - }); + super.start(context); + plugin = this; } - - // Code copied from PlatformLogWriter.getLog(). Why is logging an IStatus so - // hard? - FrameworkLogEntry createLogEntry(IStatus status) { - Throwable t = status.getException(); - ArrayList childlist = new ArrayList(); - - int stackCode = t instanceof CoreException ? 1 : 0; - // ensure a substatus inside a CoreException is properly logged - if (stackCode == 1) { - IStatus coreStatus = ((CoreException) t).getStatus(); - if (coreStatus != null) { - childlist.add(createLogEntry(coreStatus)); - } - } - - if (status.isMultiStatus()) { - IStatus[] children = status.getChildren(); - for (int i = 0; i < children.length; i++) { - childlist.add(createLogEntry(children[i])); - } - } - FrameworkLogEntry[] children = (FrameworkLogEntry[]) (childlist.size() == 0 ? null : childlist.toArray(new FrameworkLogEntry[childlist.size()])); - - return new FrameworkLogEntry(status.getPlugin(), status.getSeverity(), status.getCode(), status.getMessage(), stackCode, t, children); + /* + * (non-Javadoc) + * + * @see + * org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext + * ) + */ + public void stop(BundleContext context) throws Exception { + plugin = null; + super.stop(context); } - - public void stop(BundleContext context) throws Exception { - if (_frameworkLogTracker != null) { - _frameworkLogTracker.close(); - _frameworkLogTracker = null; - } + /** + * Returns the shared instance + * + * @return the shared instance + */ + public static Activator getDefault() { + return plugin; } } Index: META-INF/MANIFEST.MF =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.core.databinding/META-INF/MANIFEST.MF,v retrieving revision 1.14 diff -u -r1.14 MANIFEST.MF --- META-INF/MANIFEST.MF 11 Apr 2008 22:18:08 -0000 1.14 +++ META-INF/MANIFEST.MF 8 Apr 2009 10:26:50 -0000 @@ -22,7 +22,9 @@ org.eclipse.core.internal.databinding.observable.masterdetail;x-friends:="org.eclipse.jface.tests.databinding", org.eclipse.core.internal.databinding.observable.tree;x-friends:="org.eclipse.jface.databinding,org.eclipse.jface.tests.databinding", org.eclipse.core.internal.databinding.validation;x-friends:="org.eclipse.jface.tests.databinding" -Require-Bundle: org.eclipse.equinox.common;bundle-version="[3.2.0,4.0.0)" +Require-Bundle: org.eclipse.equinox.common;bundle-version="[3.2.0,4.0.0)", + org.eclipse.osgi, + org.eclipse.core.runtime;bundle-version="3.2.0" Import-Package-Comment: see http://wiki.eclipse.org/ Import-Package: com.ibm.icu.text, org.osgi.framework;version="[1.4.0,2.0.0)";resolution:=optional, @@ -31,4 +33,5 @@ Bundle-RequiredExecutionEnvironment: CDC-1.1/Foundation-1.1, J2SE-1.4 Bundle-Activator: org.eclipse.core.internal.databinding.Activator -Bundle-ActivationPolicy: lazy +Eclipse-LazyStart: true +