Browse Source

Nameprovider für Interfaces angepasst

benjamin.schwertfeger@gmail.com 13 years ago
parent
commit
0c77f178c2

+ 15 - 0
plugins/org.yakindu.sct.model.stext/src/org/yakindu/sct/model/stext/naming/StextNameProvider.java

@@ -1,5 +1,7 @@
 package org.yakindu.sct.model.stext.naming;
 
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.xtext.EcoreUtil2;
 import org.eclipse.xtext.naming.IQualifiedNameConverter;
 import org.eclipse.xtext.naming.QualifiedName;
 import org.eclipse.xtext.util.Strings;
@@ -27,4 +29,17 @@ public class StextNameProvider extends SGraphNameProvider {
 		}
 		return name;
 	}
+
+	protected QualifiedName getNamespace(EObject child) {
+		QualifiedName name = super.getNamespace(child);
+		if (!(child instanceof InterfaceScope)) {
+			InterfaceScope interfaceScope = EcoreUtil2.getContainerOfType(
+					child, InterfaceScope.class);
+			if (interfaceScope != null
+					&& getFullyQualifiedName(interfaceScope) != null) {
+				name = getFullyQualifiedName(interfaceScope);
+			}
+		}
+		return name;
+	}
 }