Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjeremie.tatibouet2015-05-21 11:49:55 -0400
committerArnaud Cuccuru2015-05-26 11:02:05 -0400
commit08f1067b5d8478a799c683ed4b65fe21b61c46d8 (patch)
tree89b3eda4b0add1d91de9caac20a2afa5785bf5a9 /extraplugins/alf
parent6653e3b70ed3d6f81931a1546a80a53c1250b7af (diff)
downloadorg.eclipse.papyrus-08f1067b5d8478a799c683ed4b65fe21b61c46d8.tar.gz
org.eclipse.papyrus-08f1067b5d8478a799c683ed4b65fe21b61c46d8.tar.xz
org.eclipse.papyrus-08f1067b5d8478a799c683ed4b65fe21b61c46d8.zip
https://bugs.eclipse.org/bugs/show_bug.cgi?id=467895
The ALF editor does not appear when a selected element is read-only. Change-Id: I6a83904297a59a2bf4fc5c07b0319957e2327bd3 Signed-off-by: jeremie.tatibouet <jeremie.tatibouet@cea.fr> Reviewed-on: https://git.eclipse.org/r/48637 Tested-by: Hudson CI Reviewed-by: Arnaud Cuccuru <arnaud.cuccuru@cea.fr> Tested-by: Arnaud Cuccuru <arnaud.cuccuru@cea.fr>
Diffstat (limited to 'extraplugins/alf')
-rw-r--r--extraplugins/alf/ui/org.eclipse.papyrus.uml.alf.properties.xtext/src/org/eclipse/papyrus/uml/alf/properties/xtext/sheet/AlfEditorPropertySectionFilter.java15
1 files changed, 15 insertions, 0 deletions
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..6a0432bc2c1 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,8 +14,10 @@ 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;
@@ -59,6 +61,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 +86,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