Difference between revisions of "JFace Data Binding/Snippets"

From Eclipsepedia

Jump to: navigation, search
(added Snippet014)
Line 1: Line 1:
Snippets that display common use cases and how they are satisfied with the JFace Data Binding API.
+
Snippets show how common use cases can be implemented using the JFace Data Binding framework. They are typically a single self-contained Java class with a main method.
 
{{JFace Data Binding}}
 
{{JFace Data Binding}}
 +
 +
<p>
 +
A great way to learn is to look at concrete examples that you can run and experiment with.
 +
You can copy any of the snippets (see below) into a scratch project within Eclipse, or using CVS, check out the complete examples project.  Just open the CVS Perspective (Window > Open Perspective > CVS) and add a new Repository Location (File > New > Other > CVS > CVS Repository Location).
 +
When done, your settings should look like this:
 +
</p>
 +
[[Image:EclipseCVSSettings.JPG]]
 +
<p>Expand the HEAD branch and browse for '''org.eclipse.jface.examples.databinding'''. You can check out the plug-in [RMB: Check out] into your Workspace as a new project.</p>
 +
<p>When checked out, you'll find the examples under '''org.eclipse.jface.examples.databinding.snippets'''. Most of the examples provide a main method, you can run it as a Java Application to see what happens.</p>
 +
 +
If you are copying single snippets into a scratch project, make sure that it is set up with the correct dependencies. You will need org.eclipse.core.databinding, org.eclipse.core.databinding.beans, and org.eclipse.jface.databinding.
  
 
=== Basic ===
 
=== Basic ===

Revision as of 22:58, 12 October 2007

Snippets show how common use cases can be implemented using the JFace Data Binding framework. They are typically a single self-contained Java class with a main method.

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

A great way to learn is to look at concrete examples that you can run and experiment with. You can copy any of the snippets (see below) into a scratch project within Eclipse, or using CVS, check out the complete examples project. Just open the CVS Perspective (Window > Open Perspective > CVS) and add a new Repository Location (File > New > Other > CVS > CVS Repository Location). When done, your settings should look like this:

EclipseCVSSettings.JPG

Expand the HEAD branch and browse for org.eclipse.jface.examples.databinding. You can check out the plug-in [RMB: Check out] into your Workspace as a new project.

When checked out, you'll find the examples under org.eclipse.jface.examples.databinding.snippets. Most of the examples provide a main method, you can run it as a Java Application to see what happens.

If you are copying single snippets into a scratch project, make sure that it is set up with the correct dependencies. You will need org.eclipse.core.databinding, org.eclipse.core.databinding.beans, and org.eclipse.jface.databinding.

Contents

Basic

WizardPage

  • Wizard Dialog - Shows how to use data binding in a wizard dialog so that validation results are displayed in the dialog's title area

ComputedValue

  • Spreadsheet - fills a Table updating cells upon change
  • Name Formatter - observable value that updates when the first or last name changes

Bindings

Master Detail

SWT

Viewers