|
Re: TableViewer, DataBindingContext and UpdateValueStrategy [message #830422 is a reply to message #816075] |
Tue, 27 March 2012 15:52 |
Mark Hoffmann Messages: 113 Registered: July 2009 Location: Jena |
Senior Member |
|
|
Agnes Thanbichler wrote on Thu, 08 March 2012 12:52Hi,
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
|
|
|
Powered by
FUDForum. Page generated in 0.01997 seconds