Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » How to connect everything together (binding and syncronisation?)
How to connect everything together (binding and syncronisation?) [message #493764] Tue, 27 October 2009 21:56 Go to next message
epoch  is currently offline epoch
Messages: 12
Registered: September 2009
Junior Member
I have a perspective with three components: a view with a treeviewer of objects, an editor (which edits the objects in the treeviewer) and a properties view which edits the selected item in the treeviewer.

I'm a bit confused on how to syncronise the objects between these views. For example, say the name of the object is changed using the properties view, how do I get the treeviewer to update (either by refresh or otherwise). If the editor part's name is the objects name and it gets changed by the properties view, how do I update the editor part name automatically?

Can somebody point me in the right direction? Basically, I'm struggling to understand how to connect all of the different components together!

Cheers
Re: How to connect everything together (binding and syncronisation?) [message #493938 is a reply to message #493764] Wed, 28 October 2009 14:49 Go to previous messageGo to next message
T. Wilhelm is currently offline T. Wilhelm
Messages: 129
Registered: July 2009
Senior Member
Hey,

all you need is a common model and the Eclipse databinding. You could do it also without Databinding, but i would prefer it because it handels a lot of things for you.

Your model could be a Singleton so it is accesible from all Views. Another Approach would be to access the model via a service.

No matter which kind of model access you do, you can then bind your objects contained by the models, to your treeviewer, properties view, and editor.

Google for eclipse + databinding to find out how it works, if you have questions, just ask.

Greetz
Willi
Re: How to connect everything together (binding and syncronisation?) [message #494619 is a reply to message #493764] Sun, 01 November 2009 09:12 Go to previous messageGo to next message
epoch  is currently offline epoch
Messages: 12
Registered: September 2009
Junior Member
Okay, I'm getting to there with my understanding, hopefully you can help me a little bit further.

I have a common data model (a singleton instance) which returns a List's of domain object (just POJO).

I bind this list to a TreeViewer using an ObservableListTreeContentProvider (IObservableFactory and TreeStructureAdvisor). My next question is, how do I get the treeviewer to update when an item is added to the list in the model? Or, when an item in the list changes?
Re: How to connect everything together (binding and syncronisation?) [message #494676 is a reply to message #494619] Mon, 02 November 2009 07:44 Go to previous message
T. Wilhelm is currently offline T. Wilhelm
Messages: 129
Registered: July 2009
Senior Member
Hi Epoch,

too bad that i dont have much experience with TreeViewer and Databinding because this technique is quite new.

Nevertheless for my TableViewer i use WritableList objects in my Model. If you add or remove some object to a WritableList, the Tableviewer will be updated automatically. So try that, i think it should work.

Greetz
Thomas
Previous Topic:Restoring empty shell for detached non-restorable views
Next Topic:RCP on OSX - Carbon, Cocoa, and SWT_AWT troubles...
Goto Forum:
  


Current Time: Sat Oct 25 07:53:06 GMT 2014

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

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