diff options
Diffstat (limited to 'org.eclipse.jface.text/src/org/eclipse/jface/text/templates/persistence/TemplateStore.java')
-rw-r--r-- | org.eclipse.jface.text/src/org/eclipse/jface/text/templates/persistence/TemplateStore.java | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/text/templates/persistence/TemplateStore.java b/org.eclipse.jface.text/src/org/eclipse/jface/text/templates/persistence/TemplateStore.java index c96ef35029b..d3ab1c0495c 100644 --- a/org.eclipse.jface.text/src/org/eclipse/jface/text/templates/persistence/TemplateStore.java +++ b/org.eclipse.jface.text/src/org/eclipse/jface/text/templates/persistence/TemplateStore.java @@ -29,7 +29,6 @@ import org.eclipse.text.templates.TemplateStoreCore; import org.eclipse.jface.preference.IPersistentPreferenceStore; import org.eclipse.jface.preference.IPreferenceStore; import org.eclipse.jface.util.IPropertyChangeListener; -import org.eclipse.jface.util.PropertyChangeEvent; /** * A collection of templates. Clients may instantiate this class. In order to @@ -111,21 +110,18 @@ public class TemplateStore extends TemplateStoreCore { @Override public final void startListeningForPreferenceChanges() { if (fPropertyListener == null) { - fPropertyListener= new IPropertyChangeListener() { - @Override - public void propertyChange(PropertyChangeEvent event) { - /* - * Don't load if we are in the process of saving ourselves. We are in sync anyway after the - * save operation, and clients may trigger reloading by listening to preference store - * updates. - */ - if (!fIgnorePreferenceStoreChanges && getKey().equals(event.getProperty())) - try { - load(); - } catch (IOException x) { - handleException(x); - } - } + fPropertyListener= event -> { + /* + * Don't load if we are in the process of saving ourselves. We are in sync anyway after the + * save operation, and clients may trigger reloading by listening to preference store + * updates. + */ + if (!fIgnorePreferenceStoreChanges && getKey().equals(event.getProperty())) + try { + load(); + } catch (IOException x) { + handleException(x); + } }; fPreferenceStore.addPropertyChangeListener(fPropertyListener); } |