use of org.eclipse.jface.util.SafeRunnable in project xtext-eclipse by eclipse.
the class FixedScopedPreferenceStore method firePropertyChangeEvent.
/*
* (non-Javadoc)
*
* @see org.eclipse.jface.preference.IPreferenceStore#firePropertyChangeEvent(java.lang.String,
* java.lang.Object, java.lang.Object)
*/
@Override
public void firePropertyChangeEvent(String name, Object oldValue, Object newValue) {
// important: create intermediate array to protect against listeners
// being added/removed during the notification
final Object[] list = getListeners();
if (list.length == 0) {
return;
}
final PropertyChangeEvent event = new PropertyChangeEvent(this, name, oldValue, newValue);
for (int i = 0; i < list.length; i++) {
final IPropertyChangeListener listener = (IPropertyChangeListener) list[i];
SafeRunner.run(new SafeRunnable(JFaceResources.getString(// $NON-NLS-1$
"PreferenceStore.changeError")) {
@Override
public void run() {
listener.propertyChange(event);
}
});
}
}
Aggregations