Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian W. Damus2014-03-04 19:03:07 +0000
committerChristian W. Damus2014-03-04 19:18:41 +0000
commit87d85c55fa7d8fbf1e3c757c9d85525b8c7bb046 (patch)
treef6172c87853fcf995b7cfdbc585fcf4439e9a335 /plugins/uml/properties/org.eclipse.papyrus.uml.properties.xtext
parent74c908d693434e48ad4be3e1321400ce7d10328b (diff)
downloadorg.eclipse.papyrus-87d85c55fa7d8fbf1e3c757c9d85525b8c7bb046.tar.gz
org.eclipse.papyrus-87d85c55fa7d8fbf1e3c757c9d85525b8c7bb046.tar.xz
org.eclipse.papyrus-87d85c55fa7d8fbf1e3c757c9d85525b8c7bb046.zip
323802: [General] Papyrus shall provide a read only mode
https://bugs.eclipse.org/bugs/show_bug.cgi?id=323802 Make new Advanced Editing property section sensitive to read-only model elements. Also update the validation infrastructure to account for the new UML2 plug-in structure in Luna (prerequisite for validation of Advanced Editing parsing).
Diffstat (limited to 'plugins/uml/properties/org.eclipse.papyrus.uml.properties.xtext')
-rw-r--r--plugins/uml/properties/org.eclipse.papyrus.uml.properties.xtext/META-INF/MANIFEST.MF3
-rw-r--r--plugins/uml/properties/org.eclipse.papyrus.uml.properties.xtext/src/org/eclipse/papyrus/uml/properties/xtext/sheet/AdvancedEditingPropertySection.java17
2 files changed, 16 insertions, 4 deletions
diff --git a/plugins/uml/properties/org.eclipse.papyrus.uml.properties.xtext/META-INF/MANIFEST.MF b/plugins/uml/properties/org.eclipse.papyrus.uml.properties.xtext/META-INF/MANIFEST.MF
index 3f4ffd76d84..209ae0c7788 100644
--- a/plugins/uml/properties/org.eclipse.papyrus.uml.properties.xtext/META-INF/MANIFEST.MF
+++ b/plugins/uml/properties/org.eclipse.papyrus.uml.properties.xtext/META-INF/MANIFEST.MF
@@ -10,7 +10,8 @@ Require-Bundle: org.eclipse.ui;bundle-version="3.105.0",
org.eclipse.papyrus.infra.gmfdiag.commands;bundle-version="1.0.0",
org.eclipse.papyrus.extensionpoints.editors;bundle-version="1.0.0",
org.eclipse.papyrus.uml.xtext.integration.ui;bundle-version="1.0.0",
- org.eclipse.xtext;bundle-version="2.4.2"
+ org.eclipse.xtext;bundle-version="2.4.2",
+ org.eclipse.papyrus.infra.emf;bundle-version="1.0.0"
Bundle-Vendor: %providerName
Bundle-ActivationPolicy: lazy
Bundle-Version: 1.0.0.qualifier
diff --git a/plugins/uml/properties/org.eclipse.papyrus.uml.properties.xtext/src/org/eclipse/papyrus/uml/properties/xtext/sheet/AdvancedEditingPropertySection.java b/plugins/uml/properties/org.eclipse.papyrus.uml.properties.xtext/src/org/eclipse/papyrus/uml/properties/xtext/sheet/AdvancedEditingPropertySection.java
index 12d2f87a082..291f284e36e 100644
--- a/plugins/uml/properties/org.eclipse.papyrus.uml.properties.xtext/src/org/eclipse/papyrus/uml/properties/xtext/sheet/AdvancedEditingPropertySection.java
+++ b/plugins/uml/properties/org.eclipse.papyrus.uml.properties.xtext/src/org/eclipse/papyrus/uml/properties/xtext/sheet/AdvancedEditingPropertySection.java
@@ -1,5 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2014 CEA LIST.
+ * Copyright (c) 2013, 2014 Itemis AG, CEA LIST, and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -7,8 +7,9 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * Itemis - Initial API and implementation
- * Ansgar Radermacher - added undo/redo support (inspired by code from Petr Bodnar)
+ * Itemis - Initial API and implementation
+ * Ansgar Radermacher - added undo/redo support (inspired by code from Petr Bodnar)
+ * Christian W. Damus (CEA) - bug 323802
*
*****************************************************************************/
@@ -27,6 +28,7 @@ import org.eclipse.papyrus.extensionpoints.editors.Activator;
import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
+import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
import org.eclipse.papyrus.uml.xtext.integration.DefaultXtextDirectEditorConfiguration;
import org.eclipse.papyrus.uml.xtext.integration.StyledTextXtextAdapter;
import org.eclipse.papyrus.uml.xtext.integration.core.ContextElementAdapter;
@@ -83,6 +85,9 @@ public class AdvancedEditingPropertySection extends
textControl.setText(printString);
}
+ if (textControl != null) {
+ textControl.setEnabled(!isReadOnly());
+ }
}
@Override
@@ -292,4 +297,10 @@ public class AdvancedEditingPropertySection extends
public EObject getContextObject() {
return getEObject();
}
+
+ @Override
+ protected boolean isReadOnly() {
+ EObject context = getContextObject();
+ return (context == null) || EMFHelper.isReadOnly(context) || super.isReadOnly();
+ }
} \ No newline at end of file

Back to the top