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 15:24 Go to next message
Johannes Spreemann is currently offline Johannes SpreemannFriend
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 07:27 Go to previous message
Simon Scholz is currently offline Simon ScholzFriend
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: Tue Oct 06 00:02:10 GMT 2015

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

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