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 06:52 Go to next message
Agnes Thanbichler is currently offline Agnes Thanbichler
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 11:52 Go to previous message
Mark Hoffmann is currently offline Mark Hoffmann
Messages: 102
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:[Databinding] Is this a good Master-Details-Binding pattern for my use case?
Next Topic:Creating additional Bar (like Status bar or Toolbar)
Goto Forum:
  


Current Time: Thu Apr 17 00:12:36 EDT 2014

Powered by FUDForum. Page generated in 0.08076 seconds