Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » JFace » React on value change along with databinding
React on value change along with databinding [message #1086694] Wed, 14 August 2013 11:24 Go to next message
Johannes Spreemann is currently offline Johannes Spreemann
Messages: 19
Registered: August 2013
Location: Germany/Netherlands
Junior Member

I have a databinding that's working perfectly. But now I want to react additional on my own if some values of several GUI elements change. Is it possible to act as some kind of subscriber to the databinding instead of using the eventlisteners of each SWT component?

Re: React on value change along with databinding [message #1097812 is a reply to message #1086694] Fri, 30 August 2013 03:27 Go to previous message
Simon Scholz is currently offline Simon Scholz
Messages: 73
Registered: April 2012
Location: Germany
Hello Johannes,

for sure you can.
Each org.eclipse.core.databinding.observable.value.IObservableValue has an addValueChangeListener method, where you can attach your own custom org.eclipse.core.databinding.observable.value.IValueChangeListener.

For instance:

IObservableValue target = WidgetProperties.text(SWT.Modify).

target.addValueChangeListener(new IValueChangeListener(){
   public void handleValueChange(ValueChangeEvent valuechangeevent){
         Object newValue = valuechangeevent.diff.getNewValue();

If you have further questions, do not hesitate to ask them Wink

Best regards,

Previous Topic:Set Selection on Tree Viewer
Next Topic:TitleAreaDialog - An exception with no message.
Goto Forum:

Current Time: Wed Aug 27 09:00:49 EDT 2014

Powered by FUDForum. Page generated in 0.01614 seconds