Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "JFace Data Binding/FAQ"

(Does Data Binding depend upon Eclipse?)
m (Where can I ask a question?)
(17 intermediate revisions by 3 users not shown)
Line 1: Line 1:
=== Does Data Binding depend upon Eclipse? ===
+
{{JFace Data Binding}}
The core Data Binding plug-in only depends upon org.eclipse.equinox.common and no other parts of Eclipse.  There are parts of Data Binding that depend upon SWT/JFace but these have been broken out into a separate plug-in, org.eclipse.jface.databinding.  For a discussion of why the core depends upon equinox common see {{bug comment|153630|9}}.
+
=== Where can I ask a question? ===
 
+
You can ask questions on the [http://www.eclipse.org/newsportal/thread.php?group=eclipse.platform.jface Eclipse JFace newsgroup]When you post please prefix the title with "[DataBinding]".
=== Does Data Binding depend upon SWT? ===
+
No.  Data Binding is meant to be UI toolkit agnostic and more specifically UI agnostic.  There is default support for SWT and JFace but this is in the org.eclipse.jface.databinding.ui project which is separate from the core Data Binding APIs that live in org.eclipse.jface.databindingFor background and when the separation occurred in see {{bug|153630}}.
+
  
 
=== How do I report a bug? ===
 
=== How do I report a bug? ===
 
On the [https://bugs.eclipse.org/bugs Eclipse bugzilla] log a bug to Eclipse > Platform > UI with "[DataBinding]" in the summary.
 
On the [https://bugs.eclipse.org/bugs Eclipse bugzilla] log a bug to Eclipse > Platform > UI with "[DataBinding]" in the summary.
  
=== When will the public API be ready? ===
+
=== Where can I find examples of how to use data binding? ===
By [http://www.eclipse.org/eclipse/development/eclipse_project_plan_3_3.html#Milestones 3.3M4] all API refactoring should have occurred and the code can be thought of as 1.0.  (Technically, it will be version 1.1, because version 1.0 of data binding shipped with Eclipse 3.2.)  But we're going to give ourselves until 3.3M5 in case any issues are found.  To view the plan item for this see {{bug|154132}}.
+
Have a look at our collection of [[JFace_Data_Binding/Snippets|Snippets]].
  
=== Where can I ask a question? ===
+
=== Where can I get the plugins? ===
You can ask questions on the [http://www.eclipse.org/newsportal/thread.php?group=eclipse.platform Eclipse Platform newsgroup]When you post please prefix the title with "[DataBinding]".
+
The JFace Data Binding plug-ins can be found in any of the following distributions on the Eclipse [http://download.eclipse.org/eclipse/downloads/ download page]:
 +
* Eclipse SDK
 +
* RCP Runtime/SDK
 +
* Platform Runtime/SDK
 +
 
 +
Just select the desired build (e.g. stable, integration, nightly) and download one of the above distributions.
 +
 
 +
The plug-ins you need are org.eclipse.core.databinding, org.eclipse.jface.databinding (if your UI is implemented using SWT and JFace), and org.eclipse.core.databinding.beans (if your model objects conform to the JavaBeans specification).
 +
 
 +
=== What is a Realm, and do I need to care? ===
 +
The data binding core plug-in does not depend on SWT but needs to talk about "being on the UI thread" in the abstract. The class Realm is similar to SWT's Display class - you can call Realm.asyncExec(Runnable) to execute code within a realm (read: on the UI thread), but it does not have any UI-specific methods or fields. If your UI is the only source of changes to your model, then everything will happen on the UI thread anyway and you don't have to worry about realms. <b>Workbench#createAndRunWorkbench</b> will initialize the default realm to be associated with the SWT UI thread if you are writing an RCP application, or a plug-in for the Eclipse Platform.  If you are writing an application that only uses SWT, data binding, and optionally JFace, you will have to provide the realm explicitly, or set up a default realm in your main method.  All of our [[JFace_Data_Binding/Snippets|Snippets]] do this - they are standalone applications that just use SWT and JFace. For more information, see the wiki page about [[JFace_Data_Binding/Realm|Realm]].
 +
 
 +
=== Does Data Binding depend on Eclipse and the OSGi runtime? ===
 +
The core Data Binding plug-in only depends on org.eclipse.equinox.common, [[ICU4J]] but no other parts of Eclipse. It will run without OSGi.  See also [[JFace Data Binding/Runtime Dependencies]].
 +
 
 +
=== Does Data Binding depend on SWT? ===
 +
No.  Data Binding is meant to be UI toolkit agnostic and more specifically UI agnostic.  There is default support for SWT and JFace but this is in the org.eclipse.jface.databinding project which is separate from the core Data Binding APIs that live in org.eclipse.core.databinding.  For background and when the separation occurred in see {{bug|153630}}.
  
 
=== How do I bind to the ValidationError of a Binding or DataBindingContext? ===
 
=== How do I bind to the ValidationError of a Binding or DataBindingContext? ===
See [http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/snippets/Snippet004DataBindingContextErrorLabel.java?rev=HEAD&content-type=text/vnd.viewcvs-markup snippet 004].
+
See [http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/snippets/Snippet004DataBindingContextErrorLabel.java?rev=HEAD&content-type=text/vnd.viewcvs-markup Snippet 004] and [http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/snippets/Snippet014WizardDialog.java?rev=HEAD&content-type=text/vnd.viewcvs-markup Snippet 014].
  
 
=== How do I run the tests? ===
 
=== How do I run the tests? ===
In order to run the tests you need to check out the following projects:
+
The main JUnit Test Suite is contained in the org.eclipse.jface.tests.databinding project.  This project contributes the "JFace-Data Binding Test Suite" to the IDE.  When invoked this suite will run all tests.
* org.eclipse.core.databinding
+
 
* org.eclipse.core.databinding.beans
+
Steps:
* org.eclipse.jface.databinding
+
# Ensure the org.eclipse.jface.tests.databinding project is in your workspace.
* org.eclipse.jface.examples.databinding
+
# Open the Run Dialog (Run->Open Run Dialog...).
* org.eclipse.jface.tests.databinding
+
# Expand the "JUnit Plug-in Test" entry.
 +
# Select the "JFace-Data Binding Test Suite" entry and select "Run".
 +
 
 +
=== Can JFace Data Binding run against older versions of Eclipse? ===
 +
Yes, we try to keep the data binding bundles compatible with the previous release of Eclipse - for example, data binding released with Eclipse 3.3 will work against Eclipse 3.2. Depending upon your needs you might need to take an extra step because of the way the released version of the bundles is compiled. For example, the compiled org.eclipse.jface.databinding bundle as released with Eclipse 3.3 will only run against Eclipse 3.3, whereas the distributions of org.eclipse.core.databinding and org.eclipse.core.databinding.beans will run just fine against Eclipse 3.2.x.  If wanting to run org.eclipse.jface.databinding against Eclipse 3.2.x you'll need to build it from source against your target platform.  For more information as to why this is necessary see {{bug|177476}}.
  
If you were to run all tests in the project you'll certainly see some failures.  The reason being that we're in the process of refactoring for the 1.0 release.  To avoid this run org.eclipse.jface.tests.databinding.BindingTestSuite.
+
[[Category:FAQ]]
 +
[[Category:Data Binding]]

Revision as of 16:49, 15 May 2009

JFace Data Binding
Home
How to Contribute
FAQ
Snippets
Concepts
Binding
Converter
Observable
Realm

Where can I ask a question?

You can ask questions on the Eclipse JFace newsgroup. When you post please prefix the title with "[DataBinding]".

How do I report a bug?

On the Eclipse bugzilla log a bug to Eclipse > Platform > UI with "[DataBinding]" in the summary.

Where can I find examples of how to use data binding?

Have a look at our collection of Snippets.

Where can I get the plugins?

The JFace Data Binding plug-ins can be found in any of the following distributions on the Eclipse download page:

  • Eclipse SDK
  • RCP Runtime/SDK
  • Platform Runtime/SDK

Just select the desired build (e.g. stable, integration, nightly) and download one of the above distributions.

The plug-ins you need are org.eclipse.core.databinding, org.eclipse.jface.databinding (if your UI is implemented using SWT and JFace), and org.eclipse.core.databinding.beans (if your model objects conform to the JavaBeans specification).

What is a Realm, and do I need to care?

The data binding core plug-in does not depend on SWT but needs to talk about "being on the UI thread" in the abstract. The class Realm is similar to SWT's Display class - you can call Realm.asyncExec(Runnable) to execute code within a realm (read: on the UI thread), but it does not have any UI-specific methods or fields. If your UI is the only source of changes to your model, then everything will happen on the UI thread anyway and you don't have to worry about realms. Workbench#createAndRunWorkbench will initialize the default realm to be associated with the SWT UI thread if you are writing an RCP application, or a plug-in for the Eclipse Platform. If you are writing an application that only uses SWT, data binding, and optionally JFace, you will have to provide the realm explicitly, or set up a default realm in your main method. All of our Snippets do this - they are standalone applications that just use SWT and JFace. For more information, see the wiki page about Realm.

Does Data Binding depend on Eclipse and the OSGi runtime?

The core Data Binding plug-in only depends on org.eclipse.equinox.common, ICU4J but no other parts of Eclipse. It will run without OSGi. See also JFace Data Binding/Runtime Dependencies.

Does Data Binding depend on SWT?

No. Data Binding is meant to be UI toolkit agnostic and more specifically UI agnostic. There is default support for SWT and JFace but this is in the org.eclipse.jface.databinding project which is separate from the core Data Binding APIs that live in org.eclipse.core.databinding. For background and when the separation occurred in see bug 153630.

How do I bind to the ValidationError of a Binding or DataBindingContext?

See Snippet 004 and Snippet 014.

How do I run the tests?

The main JUnit Test Suite is contained in the org.eclipse.jface.tests.databinding project. This project contributes the "JFace-Data Binding Test Suite" to the IDE. When invoked this suite will run all tests.

Steps:

  1. Ensure the org.eclipse.jface.tests.databinding project is in your workspace.
  2. Open the Run Dialog (Run->Open Run Dialog...).
  3. Expand the "JUnit Plug-in Test" entry.
  4. Select the "JFace-Data Binding Test Suite" entry and select "Run".

Can JFace Data Binding run against older versions of Eclipse?

Yes, we try to keep the data binding bundles compatible with the previous release of Eclipse - for example, data binding released with Eclipse 3.3 will work against Eclipse 3.2. Depending upon your needs you might need to take an extra step because of the way the released version of the bundles is compiled. For example, the compiled org.eclipse.jface.databinding bundle as released with Eclipse 3.3 will only run against Eclipse 3.3, whereas the distributions of org.eclipse.core.databinding and org.eclipse.core.databinding.beans will run just fine against Eclipse 3.2.x. If wanting to run org.eclipse.jface.databinding against Eclipse 3.2.x you'll need to build it from source against your target platform. For more information as to why this is necessary see bug 177476.

Back to the top