Skip to main content

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:Quick find (Ctrl + F) does not work for virtual Table Viewer
Next Topic:Metadata in TreeViewer
Goto Forum:

Current Time: Sun Sep 23 12:28:34 GMT 2018

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

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

Back to the top