Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » JFace » TableViewer, DataBindingContext and UpdateValueStrategy
TableViewer, DataBindingContext and UpdateValueStrategy [message #816075] Thu, 08 March 2012 11:52 Go to next message
Agnes Thanbichler is currently offline Agnes ThanbichlerFriend
Messages: 1
Registered: March 2012
Junior Member
Hi,

is there a possibility to perfom databinding on a table by using the DatabindingContext and UpdateValueStrategy?

The following points would be useful also on the table/table contents
1. Restrict updates on a table (UpdateValueStrategy.POLICY_ON_REQUEST)
2. Use converters
3. Use validators (for editing)

With ViewerSupport, I could bind my emf object to the table. However, I cannot find a way of using a (EMF)DataBindingContext like I already did with other controls.

Thanks for any help!

Regards,
Agnes
Re: TableViewer, DataBindingContext and UpdateValueStrategy [message #830422 is a reply to message #816075] Tue, 27 March 2012 15:52 Go to previous message
Mark Hoffmann is currently offline Mark HoffmannFriend
Messages: 113
Registered: July 2009
Location: Jena
Senior Member
Agnes Thanbichler wrote on Thu, 08 March 2012 12:52
Hi,

is there a possibility to perfom databinding on a table by using the DatabindingContext and UpdateValueStrategy?

The following points would be useful also on the table/table contents
1. Restrict updates on a table (UpdateValueStrategy.POLICY_ON_REQUEST)
2. Use converters
3. Use validators (for editing)

With ViewerSupport, I could bind my emf object to the table. However, I cannot find a way of using a (EMF)DataBindingContext like I already did with other controls.

Thanks for any help!

Regards,
Agnes


Hi,
you can use the TableViewer for your tables. Then you have ObservableListContentProvider and ObservableMapLabelProvider.

For this you need no DataBindingContext. As input for the table you usually set an IObservableList/IObservableSet.

For point 1 you can bind you model to a WritableList using DataBindingContext#bindList using an UpdateListStrategy. You can set a converter to the UpdateListStrategy.
If you need a validator you have to use master details binding, because you want to edit a certain field in your list of objects. There is an ObservableValueEditingSupport to bring databinding into an editable table viewer.


Look at the snippets at the link below for master details binding and viewers binding with editing support.
http://wiki.eclipse.org/JFace_Data_Binding/Snippets

Regards,
Mark
Previous Topic:Any pitfalls when using a TreeViewer to show a Table?
Next Topic:Cell vertical block selection in Table/Tree Viewer
Goto Forum:
  


Current Time: Tue Mar 19 11:27:23 GMT 2024

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

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

Back to the top