Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'extraplugins/alf')
-rw-r--r--extraplugins/alf/core/org.eclipse.papyrus.uml.alf.transaction/META-INF/MANIFEST.MF3
-rw-r--r--extraplugins/alf/core/org.eclipse.papyrus.uml.alf.transaction/src/org/eclipse/papyrus/uml/alf/transaction/observation/listener/FUMLElementListener.java5
-rw-r--r--extraplugins/alf/ui/org.eclipse.papyrus.uml.alf.preferences/.classpath7
-rw-r--r--extraplugins/alf/ui/org.eclipse.papyrus.uml.alf.preferences/.project28
-rw-r--r--extraplugins/alf/ui/org.eclipse.papyrus.uml.alf.preferences/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--extraplugins/alf/ui/org.eclipse.papyrus.uml.alf.preferences/META-INF/MANIFEST.MF13
-rw-r--r--extraplugins/alf/ui/org.eclipse.papyrus.uml.alf.preferences/about.html28
-rw-r--r--extraplugins/alf/ui/org.eclipse.papyrus.uml.alf.preferences/build.properties8
-rw-r--r--extraplugins/alf/ui/org.eclipse.papyrus.uml.alf.preferences/plugin.xml14
-rw-r--r--extraplugins/alf/ui/org.eclipse.papyrus.uml.alf.preferences/pom.xml14
-rw-r--r--extraplugins/alf/ui/org.eclipse.papyrus.uml.alf.preferences/src/org/eclipse/papyrus/uml/alf/preferences/Activator.java50
-rw-r--r--extraplugins/alf/ui/org.eclipse.papyrus.uml.alf.preferences/src/org/eclipse/papyrus/uml/alf/preferences/AlfIntegrationPreferences.java66
-rw-r--r--extraplugins/alf/ui/org.eclipse.papyrus.uml.alf.preferences/src/org/eclipse/papyrus/uml/alf/preferences/AlfIntegrationPreferencesConstants.java25
-rw-r--r--extraplugins/alf/ui/org.eclipse.papyrus.uml.alf.preferences/src/org/eclipse/papyrus/uml/alf/preferences/AlfIntegrationPreferencesUtil.java35
-rw-r--r--extraplugins/alf/ui/org.eclipse.papyrus.uml.alf.properties.xtext/META-INF/MANIFEST.MF3
-rw-r--r--extraplugins/alf/ui/org.eclipse.papyrus.uml.alf.properties.xtext/src/org/eclipse/papyrus/uml/alf/properties/xtext/sheet/AlfEditorPropertySectionFilter.java19
16 files changed, 322 insertions, 3 deletions
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<Element, List<Notification>> modifications = new HashMap<Element, List<Notification>>();
diff --git a/extraplugins/alf/ui/org.eclipse.papyrus.uml.alf.preferences/.classpath b/extraplugins/alf/ui/org.eclipse.papyrus.uml.alf.preferences/.classpath
new file mode 100644
index 00000000000..b1dabee3829
--- /dev/null
+++ b/extraplugins/alf/ui/org.eclipse.papyrus.uml.alf.preferences/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/extraplugins/alf/ui/org.eclipse.papyrus.uml.alf.preferences/.project b/extraplugins/alf/ui/org.eclipse.papyrus.uml.alf.preferences/.project
new file mode 100644
index 00000000000..80913d0f4e5
--- /dev/null
+++ b/extraplugins/alf/ui/org.eclipse.papyrus.uml.alf.preferences/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.papyrus.uml.alf.preferences</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/extraplugins/alf/ui/org.eclipse.papyrus.uml.alf.preferences/.settings/org.eclipse.jdt.core.prefs b/extraplugins/alf/ui/org.eclipse.papyrus.uml.alf.preferences/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 00000000000..11f6e462df7
--- /dev/null
+++ b/extraplugins/alf/ui/org.eclipse.papyrus.uml.alf.preferences/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,7 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
+org.eclipse.jdt.core.compiler.compliance=1.7
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.7
diff --git a/extraplugins/alf/ui/org.eclipse.papyrus.uml.alf.preferences/META-INF/MANIFEST.MF b/extraplugins/alf/ui/org.eclipse.papyrus.uml.alf.preferences/META-INF/MANIFEST.MF
new file mode 100644
index 00000000000..b67aa16ce5f
--- /dev/null
+++ b/extraplugins/alf/ui/org.eclipse.papyrus.uml.alf.preferences/META-INF/MANIFEST.MF
@@ -0,0 +1,13 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: ALF Preferences (Incubation)
+Bundle-SymbolicName: org.eclipse.papyrus.uml.alf.preferences;singleton:=true
+Bundle-Version: 0.7.0.qualifier
+Bundle-Activator: org.eclipse.papyrus.uml.alf.preferences.Activator
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.gmf.runtime.common.ui
+Bundle-RequiredExecutionEnvironment: JavaSE-1.7
+Bundle-ActivationPolicy: lazy
+Bundle-Vendor: Eclipse Modeling Project
+Export-Package: org.eclipse.papyrus.uml.alf.preferences
diff --git a/extraplugins/alf/ui/org.eclipse.papyrus.uml.alf.preferences/about.html b/extraplugins/alf/ui/org.eclipse.papyrus.uml.alf.preferences/about.html
new file mode 100644
index 00000000000..82d49bf5f81
--- /dev/null
+++ b/extraplugins/alf/ui/org.eclipse.papyrus.uml.alf.preferences/about.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>June 5, 2007</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
+
+</body>
+</html>
diff --git a/extraplugins/alf/ui/org.eclipse.papyrus.uml.alf.preferences/build.properties b/extraplugins/alf/ui/org.eclipse.papyrus.uml.alf.preferences/build.properties
new file mode 100644
index 00000000000..0545496cbde
--- /dev/null
+++ b/extraplugins/alf/ui/org.eclipse.papyrus.uml.alf.preferences/build.properties
@@ -0,0 +1,8 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml,\
+ about.html,\
+ build.properties
+src.includes = about.html
diff --git a/extraplugins/alf/ui/org.eclipse.papyrus.uml.alf.preferences/plugin.xml b/extraplugins/alf/ui/org.eclipse.papyrus.uml.alf.preferences/plugin.xml
new file mode 100644
index 00000000000..325969567a2
--- /dev/null
+++ b/extraplugins/alf/ui/org.eclipse.papyrus.uml.alf.preferences/plugin.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+ <extension
+ point="org.eclipse.ui.preferencePages">
+ <page
+ category="org.eclipse.papyrus.embeddededitors"
+ class="org.eclipse.papyrus.uml.alf.preferences.AlfIntegrationPreferences"
+ id="org.eclipse.papyrus.uml.alf.preferences.alf_preferences"
+ name="Alf (Action Language for Foundational UML)">
+ </page>
+ </extension>
+
+</plugin>
diff --git a/extraplugins/alf/ui/org.eclipse.papyrus.uml.alf.preferences/pom.xml b/extraplugins/alf/ui/org.eclipse.papyrus.uml.alf.preferences/pom.xml
new file mode 100644
index 00000000000..3afbcfcd668
--- /dev/null
+++ b/extraplugins/alf/ui/org.eclipse.papyrus.uml.alf.preferences/pom.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <artifactId>org.eclipse.papyrus</artifactId>
+ <groupId>org.eclipse.papyrus</groupId>
+ <version>1.1.0-SNAPSHOT</version>
+ <relativePath>../../../../releng/top-pom-extras.xml</relativePath>
+ </parent>
+ <artifactId>org.eclipse.papyrus.uml.alf.preferences</artifactId>
+ <groupId>org.eclipse.papyrus</groupId>
+ <version>0.7.0-SNAPSHOT</version>
+ <packaging>eclipse-plugin</packaging>
+</project> \ No newline at end of file
diff --git a/extraplugins/alf/ui/org.eclipse.papyrus.uml.alf.preferences/src/org/eclipse/papyrus/uml/alf/preferences/Activator.java b/extraplugins/alf/ui/org.eclipse.papyrus.uml.alf.preferences/src/org/eclipse/papyrus/uml/alf/preferences/Activator.java
new file mode 100644
index 00000000000..dd58e2cb882
--- /dev/null
+++ b/extraplugins/alf/ui/org.eclipse.papyrus.uml.alf.preferences/src/org/eclipse/papyrus/uml/alf/preferences/Activator.java
@@ -0,0 +1,50 @@
+package org.eclipse.papyrus.uml.alf.preferences;
+
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.eclipse.papyrus.uml.alf.preferences"; //$NON-NLS-1$
+
+ // The shared instance
+ private static Activator plugin;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+}
diff --git a/extraplugins/alf/ui/org.eclipse.papyrus.uml.alf.preferences/src/org/eclipse/papyrus/uml/alf/preferences/AlfIntegrationPreferences.java b/extraplugins/alf/ui/org.eclipse.papyrus.uml.alf.preferences/src/org/eclipse/papyrus/uml/alf/preferences/AlfIntegrationPreferences.java
new file mode 100644
index 00000000000..781d9d0862e
--- /dev/null
+++ b/extraplugins/alf/ui/org.eclipse.papyrus.uml.alf.preferences/src/org/eclipse/papyrus/uml/alf/preferences/AlfIntegrationPreferences.java
@@ -0,0 +1,66 @@
+/*****************************************************************************
+ * Copyright (c) 2015 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Jeremie Tatibouet (CEA LIST)
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.alf.preferences;
+
+import org.eclipse.gmf.runtime.common.ui.preferences.CheckBoxFieldEditor;
+import org.eclipse.jface.preference.FieldEditorPreferencePage;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+
+public class AlfIntegrationPreferences extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {
+
+ private final static String preferencePageTitle = "Configure Alf support in Papyrus Model";
+
+ public AlfIntegrationPreferences() {
+ super(GRID);
+ }
+
+ @Override
+ protected void createFieldEditors() {
+ final CheckBoxFieldEditor enableAlfSupport = new CheckBoxFieldEditor(
+ AlfIntegrationPreferencesConstants.ALF_SUPPORT,
+ AlfIntegrationPreferencesConstants.ALF_SUPPORT_LABEL,
+ this.getFieldEditorParent());
+
+ final CheckBoxFieldEditor enableSynchronization = new CheckBoxFieldEditor(
+ AlfIntegrationPreferencesConstants.ALF_AUTOMATIC_SYNCHRONIZATION,
+ AlfIntegrationPreferencesConstants.ALF_AUTOMATIC_SYNCHRONIZATION_LABEL,
+ this.getFieldEditorParent());
+ enableSynchronization.setEnabled(
+ AlfIntegrationPreferencesUtil.isAlfSupportEnabled(),
+ this.getFieldEditorParent());
+
+ enableAlfSupport.getCheckbox().addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ if (enableAlfSupport.getBooleanValue()) {
+ enableSynchronization.setEnabled(true, AlfIntegrationPreferences.this.getFieldEditorParent());
+ } else {
+ enableSynchronization.setEnabled(false, AlfIntegrationPreferences.this.getFieldEditorParent());
+ }
+ }
+ });
+
+ this.addField(enableAlfSupport);
+ this.addField(enableSynchronization);
+ }
+
+ @Override
+ public void init(IWorkbench workbench) {
+ setPreferenceStore(Activator.getDefault().getPreferenceStore());
+ setDescription(preferencePageTitle);
+ }
+}
diff --git a/extraplugins/alf/ui/org.eclipse.papyrus.uml.alf.preferences/src/org/eclipse/papyrus/uml/alf/preferences/AlfIntegrationPreferencesConstants.java b/extraplugins/alf/ui/org.eclipse.papyrus.uml.alf.preferences/src/org/eclipse/papyrus/uml/alf/preferences/AlfIntegrationPreferencesConstants.java
new file mode 100644
index 00000000000..33a24007b47
--- /dev/null
+++ b/extraplugins/alf/ui/org.eclipse.papyrus.uml.alf.preferences/src/org/eclipse/papyrus/uml/alf/preferences/AlfIntegrationPreferencesConstants.java
@@ -0,0 +1,25 @@
+/*****************************************************************************
+ * Copyright (c) 2015 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Jeremie Tatibouet (CEA LIST)
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.alf.preferences;
+
+public class AlfIntegrationPreferencesConstants {
+
+ public final static String ALF_SUPPORT = "ALF_SUPPORT_ENABLED";
+
+ public final static String ALF_SUPPORT_LABEL = "Enable Alf support (Class, Package, Signal, DataType, Enumeration, Association and Activity can be edited through text)";
+
+ public final static String ALF_AUTOMATIC_SYNCHRONIZATION = "ALF_AUTOMATIC_SYNCHRONIZATION";
+
+ public final static String ALF_AUTOMATIC_SYNCHRONIZATION_LABEL = "Enable synchronization (Model and text are automatically synchronized) - [EXPERIMENTAL]";
+}
diff --git a/extraplugins/alf/ui/org.eclipse.papyrus.uml.alf.preferences/src/org/eclipse/papyrus/uml/alf/preferences/AlfIntegrationPreferencesUtil.java b/extraplugins/alf/ui/org.eclipse.papyrus.uml.alf.preferences/src/org/eclipse/papyrus/uml/alf/preferences/AlfIntegrationPreferencesUtil.java
new file mode 100644
index 00000000000..998c2ff5303
--- /dev/null
+++ b/extraplugins/alf/ui/org.eclipse.papyrus.uml.alf.preferences/src/org/eclipse/papyrus/uml/alf/preferences/AlfIntegrationPreferencesUtil.java
@@ -0,0 +1,35 @@
+/*****************************************************************************
+ * Copyright (c) 2015 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Jeremie Tatibouet (CEA LIST)
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.alf.preferences;
+
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.preferences.IPreferencesService;
+
+public class AlfIntegrationPreferencesUtil {
+
+ private final static String qualifier = "org.eclipse.papyrus.uml.alf.preferences";
+
+ public static boolean isAlfSupportEnabled() {
+ IPreferencesService preferencesService = Platform.getPreferencesService();
+ return preferencesService.getBoolean(qualifier,
+ AlfIntegrationPreferencesConstants.ALF_SUPPORT, false, null);
+ }
+
+ public static boolean isAlfAutoSyncEnabled() {
+ IPreferencesService preferencesService = Platform.getPreferencesService();
+ boolean syncEnabled = preferencesService.getBoolean(qualifier,
+ AlfIntegrationPreferencesConstants.ALF_AUTOMATIC_SYNCHRONIZATION, false, null);
+ return syncEnabled && isAlfSupportEnabled();
+ }
+}
diff --git a/extraplugins/alf/ui/org.eclipse.papyrus.uml.alf.properties.xtext/META-INF/MANIFEST.MF b/extraplugins/alf/ui/org.eclipse.papyrus.uml.alf.properties.xtext/META-INF/MANIFEST.MF
index 357c97ee8a6..3c62be446a9 100644
--- a/extraplugins/alf/ui/org.eclipse.papyrus.uml.alf.properties.xtext/META-INF/MANIFEST.MF
+++ b/extraplugins/alf/ui/org.eclipse.papyrus.uml.alf.properties.xtext/META-INF/MANIFEST.MF
@@ -23,7 +23,8 @@ Require-Bundle: org.eclipse.ui;bundle-version="3.105.0",
org.eclipse.papyrus.uml.alf.libraries;bundle-version="1.1.0",
org.eclipse.papyrus.uml.alf.transaction;bundle-version="0.7.0",
org.eclipse.papyrus.uml.alf.text;bundle-version="0.7.0",
- org.eclipse.compare
+ org.eclipse.compare,
+ org.eclipse.papyrus.uml.alf.preferences;bundle-version="0.7.0"
Bundle-Vendor: Eclipse Modeling Project
Bundle-ActivationPolicy: lazy
Bundle-Version: 0.7.0.qualifier
diff --git a/extraplugins/alf/ui/org.eclipse.papyrus.uml.alf.properties.xtext/src/org/eclipse/papyrus/uml/alf/properties/xtext/sheet/AlfEditorPropertySectionFilter.java b/extraplugins/alf/ui/org.eclipse.papyrus.uml.alf.properties.xtext/src/org/eclipse/papyrus/uml/alf/properties/xtext/sheet/AlfEditorPropertySectionFilter.java
index 4da0952f1a4..2d26942bbfa 100644
--- a/extraplugins/alf/ui/org.eclipse.papyrus.uml.alf.properties.xtext/src/org/eclipse/papyrus/uml/alf/properties/xtext/sheet/AlfEditorPropertySectionFilter.java
+++ b/extraplugins/alf/ui/org.eclipse.papyrus.uml.alf.properties.xtext/src/org/eclipse/papyrus/uml/alf/properties/xtext/sheet/AlfEditorPropertySectionFilter.java
@@ -14,10 +14,13 @@ package org.eclipse.papyrus.uml.alf.properties.xtext.sheet;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart;
import org.eclipse.jface.viewers.IFilter;
+import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
import org.eclipse.papyrus.uml.alf.transaction.observation.listener.filter.FUMLScopeUtil;
import org.eclipse.uml2.uml.Element;
+import org.eclipse.papyrus.uml.alf.preferences.AlfIntegrationPreferencesUtil;
/**
* This class constrains the availability of the embedded ALF editor.
@@ -43,7 +46,8 @@ public class AlfEditorPropertySectionFilter implements IFilter {
public boolean select(Object toTest) {
Element element = this.resolveSemanticElement(toTest);
boolean accepted = false;
- if(element!=null){
+ if(element!=null &&
+ AlfIntegrationPreferencesUtil.isAlfSupportEnabled()){
accepted = this.isValidInput(element);
}
return accepted;
@@ -59,6 +63,11 @@ public class AlfEditorPropertySectionFilter implements IFilter {
* @return true if element is accepted as an input false otherwise
*/
private boolean isValidInput(Element element){
+ /*1. First constraint: the element must be modifiable (i.e. not read only)*/
+ if(!this.isModifiable(element)){
+ return false;
+ }
+ /*2. It should be in the scope supported by the ALF editor*/
if(FUMLScopeUtil.isClass(element)){
return true;
}else if(FUMLScopeUtil.isPackage(element)){
@@ -79,6 +88,14 @@ public class AlfEditorPropertySectionFilter implements IFilter {
return false;
}
+ private boolean isModifiable(Element element){
+ Resource resource = element.eResource();
+ if(resource != null ){
+ return !EMFHelper.isReadOnly(element);
+ }
+ return false;
+ }
+
/**
* From a selection this methods tries to extract the underlying model element
*

Back to the top