Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » [databinding] Example for remove/add Viewer entries
[databinding] Example for remove/add Viewer entries [message #542352] Thu, 24 June 2010 15:12 Go to next message
Daniel Krügler is currently offline Daniel KrüglerFriend
Messages: 853
Registered: July 2009
Senior Member
I would like to ask, whether there exists a jface databinding
example/snippet, where the binding is used to add and remove
TableViewer or TreeViewer entries. I have found a lot of examples,
where Eclipse databinding is used, to synchronize the *contents* of
individual viewer entries, but not so for databinding of structural
changes (adding or removing elements) of viewers.

I would appreciate any hint where I should have a look at!

Thanks & Greetings from Bremen,

Daniel Krügler
Re: [databinding] Example for remove/add Viewer entries [message #542734 is a reply to message #542352] Fri, 25 June 2010 18:26 Go to previous messageGo to next message
Tim  is currently offline Tim Friend
Messages: 12
Registered: December 2009
Junior Member
Hi,

yes there exist a lot of snippets, and the databinding framework is a great thing.

I would suggest you to look here:
http://wiki.eclipse.org/JFace_Data_Binding

A lot of snippets you found here:
http://wiki.eclipse.org/JFace_Data_Binding/Snippets

The best way is, if you check out the following plugin from the eclipse repo:
org.eclipse.jface.examples.databinding

Interesting jface snippets you found here:
http://wiki.eclipse.org/JFaceSnippets

Hope this helps.
Re: [databinding] Example for remove/add Viewer entries [message #542991 is a reply to message #542734] Mon, 28 June 2010 07:03 Go to previous messageGo to next message
T. Wilhelm is currently offline T. WilhelmFriend
Messages: 129
Registered: July 2009
Senior Member
Hi Daniel,

i think you dont really need an example because adding and removing items should be done automatically when changing your List (which you bind to the Tableviewer) in your model.

Do you bind a WritableList to your Tableviewer? If that is the case, just call myWritableList.add(myNewItem). The viewer should update itself, you dont have to do anything

Greetz
Thomas
Re: [databinding] Example for remove/add Viewer entries [message #543369 is a reply to message #542991] Tue, 29 June 2010 08:12 Go to previous message
Daniel Krügler is currently offline Daniel KrüglerFriend
Messages: 853
Registered: July 2009
Senior Member
On 28.06.2010 09:03, T. Wilhelm wrote:
> Hi Daniel,
>
> i think you dont really need an example because adding and removing
> items should be done automatically when changing your List (which you
> bind to the Tableviewer) in your model.
> Do you bind a WritableList to your Tableviewer? If that is the case,
> just call myWritableList.add(myNewItem). The viewer should update
> itself, you dont have to do anything

Thanks Thomas and Tim for your help and sorry for my late response,
but I was offline during this weekend.

Maybe I should make my intention more clearer: We use a lot of
databinding from jgoodies and we are considering to switch to
jface databinding where appropriate. In jgoodies databinding,
you can directly bind the so-called ValueModel of list content
changes to widgets and I expected that a similar binding would
naturally be used in jface data binding as well. I understand
that I can simply add or remove elements from a WritableList,
but I wanted to stay away from manually binding this to
Button.SelectionChange events. IMO the more appropriate solution
is add a binding to a button and to combine this with the
actual removal/addition of list elements. The question is, what
is the appropriate way of doing that in jface databinding?

Thanks again & Greetings from Bremen,

Daniel Krügler
Previous Topic:I want do something before closing a view
Next Topic:Disable close (x) in an Editor
Goto Forum:
  


Current Time: Tue Apr 16 15:32:07 GMT 2024

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

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

Back to the top