Free tutorials for Java, Eclipse and Web programming



Eclipse JFace Databinding - Tutorial

Lars Vogel

Version 0.5

10.06.2009

Revision History
Revision 0.123.05.2008Lars Vogel
Created Article
Revision 0.225.12.2008Lars Vogel
Renamed projects, included ControlDecoration
Revision 0.322.03.2009Lars Vogel
Moved model to separate plugin
Revision 0.423.03.2009Lars Vogel
Introduced listviewer
Revision 0.510.06.2009Lars Vogel
Updated to Eclipse 3.5 (Galileo)

Eclipse JFace Databinding

This article explains the Eclipse Jface Databinding. Databinding provides a flexible way of connecting a domain model with the User Interface. This article will explain how to connect your model with the UI so that both will be automatically synchronized. It will demonstrate the usage of validators and field decorators. EMF databinding is also demonstrated.

The article assumes that you are familiar with Eclipse RCP development. In this article Eclipse 3.5 (Galileo) is used.


Table of Contents

1. Eclipse Data Binding - Overview
2. Domain Model
2.1. Overview
2.2. Create Plugin
3. Data Binding with SWT controls
3.1. RCP project
3.2. Model dependencies
3.3. Eclipse Databinding dependencies
3.4. UserInterface
3.5. Run
4. JFace Databinding
4.1. Overview
4.2. JFace Listviewer
5. Using Eclipse Data Binding with Pojos
5.1. Overview
5.2. Example
6. Customer Validations and ControlDecoration
7. Eclipse Data Binding with EMF
8. Thank you
9. Questions and Discussion
10. Links and Literature
10.1. Source Code
10.2. Eclipse DataBinding Resources
10.3. Other Resources

1. Eclipse Data Binding - Overview

The Eclipse Data Binding connects your domain model and the user interface. Changes in both will be automatically synchronized. You can use default or customized data validators to check the data and can use converters to convert the data between the UI and the domain model.

We will build an application which displays the data of a person and lets you change the person in the UI. Can you also trigger a direct change in the model via a button. Changes in the UI and the model will be synchronized with each other.