From 455f4aad0b34872dca6ba98c6e46f94558c917c3 Mon Sep 17 00:00:00 2001 From: jeremie.tatibouet Date: Tue, 26 May 2015 15:24:29 +0200 Subject: Provide a preference page for the Papyrus Alf integration. The nominal behavior is that Alf tooling is disabled. The user can next enabled it through the preference page and additionnaly activate the automated synchronization. Answers to bug 468312. Change-Id: I8c3102b0bb450818e42b921007a2ad49bba89803 Signed-off-by: jeremie.tatibouet Reviewed-on: https://git.eclipse.org/r/48638 Tested-by: Hudson CI Reviewed-by: Arnaud Cuccuru Tested-by: Arnaud Cuccuru --- .../org.eclipse.papyrus.uml.alf.transaction/META-INF/MANIFEST.MF | 3 ++- .../alf/transaction/observation/listener/FUMLElementListener.java | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'extraplugins/alf/core') diff --git a/extraplugins/alf/core/org.eclipse.papyrus.uml.alf.transaction/META-INF/MANIFEST.MF b/extraplugins/alf/core/org.eclipse.papyrus.uml.alf.transaction/META-INF/MANIFEST.MF index 64d3a5a0f93..166fe48fd00 100644 --- a/extraplugins/alf/core/org.eclipse.papyrus.uml.alf.transaction/META-INF/MANIFEST.MF +++ b/extraplugins/alf/core/org.eclipse.papyrus.uml.alf.transaction/META-INF/MANIFEST.MF @@ -18,7 +18,8 @@ Require-Bundle: org.eclipse.ui, org.eclipse.papyrus.uml.alf;bundle-version="1.1.0", org.eclipse.papyrus.uml.alf.text;bundle-version="0.7.0", org.eclipse.papyrus.infra.core.log;bundle-version="1.1.0", - org.eclipse.compare + org.eclipse.compare, + org.eclipse.papyrus.uml.alf.preferences Bundle-RequiredExecutionEnvironment: JavaSE-1.7 Bundle-ActivationPolicy: lazy Export-Package: org.eclipse.papyrus.uml.alf.transaction, diff --git a/extraplugins/alf/core/org.eclipse.papyrus.uml.alf.transaction/src/org/eclipse/papyrus/uml/alf/transaction/observation/listener/FUMLElementListener.java b/extraplugins/alf/core/org.eclipse.papyrus.uml.alf.transaction/src/org/eclipse/papyrus/uml/alf/transaction/observation/listener/FUMLElementListener.java index 1c2c9402bde..6476489f4a8 100644 --- a/extraplugins/alf/core/org.eclipse.papyrus.uml.alf.transaction/src/org/eclipse/papyrus/uml/alf/transaction/observation/listener/FUMLElementListener.java +++ b/extraplugins/alf/core/org.eclipse.papyrus.uml.alf.transaction/src/org/eclipse/papyrus/uml/alf/transaction/observation/listener/FUMLElementListener.java @@ -26,6 +26,7 @@ import org.eclipse.emf.transaction.ResourceSetChangeEvent; import org.eclipse.emf.transaction.ResourceSetListenerImpl; import org.eclipse.emf.transaction.RollbackException; import org.eclipse.emf.transaction.TransactionalEditingDomain; +import org.eclipse.papyrus.uml.alf.preferences.AlfIntegrationPreferencesUtil; import org.eclipse.papyrus.uml.alf.transaction.commit.ISyncScenario; import org.eclipse.papyrus.uml.alf.transaction.commit.ScenarioFactory; import org.eclipse.papyrus.uml.alf.transaction.observation.listener.filter.FUMLFilter; @@ -53,6 +54,10 @@ public class FUMLElementListener extends ResourceSetListenerImpl { * Note this is not always possible (e.g. the user has ongoing changes in the text) */ public Command transactionAboutToCommit(ResourceSetChangeEvent event) throws RollbackException { + /* 0. If the user disabled the synchronization then we do not exploit notifications*/ + if(!AlfIntegrationPreferencesUtil.isAlfAutoSyncEnabled()){ + return null; + } /* 1. Initialization */ CompoundCommand subCommands = new CompoundCommand("Synchronization"); HashMap> modifications = new HashMap>(); -- cgit v1.2.3