svn commit: r18918 - trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/FacadeEUMLImpl.java

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: thn
Date: 2010-12-12 07:04:38-0800
New Revision: 18918

Modified:
   trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/FacadeEUMLImpl.java

Log:
also handle (eCore) profile elements in getNamespace and getName

Modified: trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/FacadeEUMLImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/FacadeEUMLImpl.java?view=diff&pathrev=18918&r1=18917&r2=18918
==============================================================================
--- trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/FacadeEUMLImpl.java	(original)
+++ trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/FacadeEUMLImpl.java	2010-12-12 07:04:38-0800
@@ -1050,6 +1050,8 @@
                 return name.toString();
             }
             return handle.toString();
+        } else if (handle instanceof EPackage) {
+            return ((EPackage) handle).getName();
         } else {
             // TODO: Some elements such as Generalization are
             // no longer named.  For a transitional period we'll
@@ -1060,9 +1062,16 @@
     }
 
     public Object getNamespace(Object handle) {
-        Object o = ((Element) handle).getOwner();
-        if (o instanceof Namespace) {
-            return o;
+        if (handle instanceof Element) {
+            Object o = ((Element) handle).getOwner();
+            if (o instanceof Namespace) {
+                return o;
+            }
+        } else if (handle instanceof DynamicEObjectImpl) {
+            EClass c = ((DynamicEObjectImpl) handle).eClass();
+            if (c != null) {
+                return c.eContainer();
+            }
         }
         return null;
     }

------------------------------------------------------
http://argouml.tigris.org/ds/viewMessage.do?dsForumId=5905&dsMessageId=2690117

To unsubscribe from this discussion, e-mail: [[email protected]].
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.