From a902576de5078c100dd7900392cc97bb96391dab Mon Sep 17 00:00:00 2001 From: Camille Letavernier Date: Wed, 5 Nov 2014 14:30:06 +0100 Subject: 450151: [Properties View] Improve the Properties View model, editor and generation tool https://bugs.eclipse.org/bugs/show_bug.cgi?id=450151 Stop listening to resource changes while saving--- .../customization/properties/editor/UIEditor.java | 28 +++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) (limited to 'plugins/customization') diff --git a/plugins/customization/org.eclipse.papyrus.customization.properties/src/org/eclipse/papyrus/customization/properties/editor/UIEditor.java b/plugins/customization/org.eclipse.papyrus.customization.properties/src/org/eclipse/papyrus/customization/properties/editor/UIEditor.java index 3e0903fba4a..8edf2aba116 100644 --- a/plugins/customization/org.eclipse.papyrus.customization.properties/src/org/eclipse/papyrus/customization/properties/editor/UIEditor.java +++ b/plugins/customization/org.eclipse.papyrus.customization.properties/src/org/eclipse/papyrus/customization/properties/editor/UIEditor.java @@ -261,6 +261,16 @@ public class UIEditor extends EcoreEditor implements ITabbedPropertySheetPageCon // } } + private boolean isSaving = false; + + protected synchronized boolean isSaving() { + return isSaving; + } + + protected synchronized void setSaving(boolean saving) { + this.isSaving = saving; + } + @Override public void doSave(IProgressMonitor progressMonitor) { if (editingDomain.getResourceToReadOnlyMap() == null) { @@ -294,10 +304,26 @@ public class UIEditor extends EcoreEditor implements ITabbedPropertySheetPageCon } } - super.doSave(progressMonitor); + setSaving(true); + try { + super.doSave(progressMonitor); + } finally { + setSaving(false); + } refreshContext(); } + /** + * @see org.eclipse.emf.ecore.presentation.EcoreEditor#handleChangedResources() + * + */ + @Override + protected void handleChangedResources() { + if (!isSaving()) { + super.handleChangedResources(); + } + } + @Override public void doSaveAs() { SaveAsDialog saveAsDialog = new SaveAsDialog(getSite().getShell()); -- cgit v1.2.1