Mercurial > hg > thermostat-tools-eclipse
view com.redhat.thermostat.tools.eclipse.plugin/src/com/redhat/thermostat/tools/eclipse/plugin/editor/DataBindingChangeSupport.java @ 98:c3002fd38e27
Fix dirty state handling for edit pages
author | Omair Majid <omajid@redhat.com> |
---|---|
date | Fri, 07 Feb 2014 12:57:54 -0500 |
parents | |
children |
line wrap: on
line source
package com.redhat.thermostat.tools.eclipse.plugin.editor; import org.eclipse.core.databinding.Binding; import org.eclipse.core.databinding.DataBindingContext; import org.eclipse.core.databinding.observable.IChangeListener; import org.eclipse.core.databinding.observable.list.IObservableList; public class DataBindingChangeSupport { public static void addChangeListener(DataBindingContext bindingContext, IChangeListener listener) { IObservableList providers = bindingContext.getValidationStatusProviders(); for (Object o : providers) { Binding b = (Binding) o; b.getTarget().addChangeListener(listener); } } public static void removeChangeListener(DataBindingContext bindingContext, IChangeListener listener) { IObservableList providers = bindingContext.getValidationStatusProviders(); for (Object o : providers) { Binding b = (Binding) o; b.getTarget().removeChangeListener(listener); } } }