Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » JFace » [databinding] Whats is the minimum to bind a custom model
[databinding] Whats is the minimum to bind a custom model [message #778522] Fri, 13 January 2012 03:41 Go to next message
Patrik Dufresne is currently offline Patrik DufresneFriend
Messages: 10
Registered: July 2009
Junior Member
Hi,

I'm using JFace databinding in my project and I feel I'm not implementing it the right way. I had a look at the BeansProperties factory to create observable for a set of object, but it doesn't fit with my model.

What if the minimum to be implemented to bond a custom model (not beans) to work with JFace databinding? My model allowed me to be notify when an object is changed (in the database). I think I need to implement some kind of SimpleValueProperty, but there is so many different class to implements after that : the native listener, the MapProperty, List property, Set property, etc.

My main usage is to bind Viewer content to my model. Currently, I'm providing a custom IObservableSet as the input ans I use a ObservableSetContentProvider. The problem is the Label provider. I had a look into the ObservableMapLabelProvider and ObservableMapCellLabelProvider, but can't find an easy way to implement an IObservable Map for a property of an IObservableSet. Seams quite complicated and redundant to implement. My guess, there is something mush easier to implement. What is it ?

Thanks
Re: [databinding] Whats is the minimum to bind a custom model [message #810248 is a reply to message #778522] Wed, 29 February 2012 22:21 Go to previous message
Patrik Dufresne is currently offline Patrik DufresneFriend
Messages: 10
Registered: July 2009
Junior Member
Hi,

I've come to realize I'm not asking the right question. The problem is not how to use JFace databinding with a custom model, but rater how to use JFace data binding with a persistence layer.

Withing my project I do have a 'huge' persistence layer with all the business rule, let call it 'HugePersistenceLayer'. It provide basic CRUD functions for domain specific object. e.g.: with a Person object, HugePersistenceLayer.update(person) persist any modification by updating the database record.

The Person class is a Java Bean. So I may use BeansObservable and BeanProperties to do my binding.

My questions:
Since I want to implement the 'Instant Bean Brew' (as describe at hxxp://andymaleh.blogspot.com/2006/12/rcp-patterns-and-anti-patterns.html): "Instead of requiring users to hit save to persist data changes, improve UI efficiency by implementing the instant-persistence-paradigm using the JFace DataBinding framework." I'm wondering how to use JFace data binding to persist the modification done by the user. i.e.: When a form is updated by the user, how do I tell JFace databinding to persists the object by calling my update() function.
Previous Topic:JFace close button
Next Topic:adding multiple columns in ListSelectionDialog
Goto Forum:
  


Current Time: Tue Mar 19 05:48:50 GMT 2024

Powered by FUDForum. Page generated in 0.02204 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top