svn commit: r18920 - trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/ModelManagementHelperEUMLImpl.java

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: thn
Date: 2010-12-12 08:34:59-0800
New Revision: 18920

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

Log:
make getRootElements(...) work for profiles too

Modified: trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/ModelManagementHelperEUMLImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/ModelManagementHelperEUMLImpl.java?view=diff&pathrev=18920&r1=18919&r2=18920
==============================================================================
--- trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/ModelManagementHelperEUMLImpl.java	(original)
+++ trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/ModelManagementHelperEUMLImpl.java	2010-12-12 08:34:59-0800
@@ -18,6 +18,7 @@
 import java.util.List;
 
 import org.argouml.model.ModelManagementHelper;
+import org.eclipse.emf.ecore.EObject;
 import org.eclipse.uml2.uml.Classifier;
 import org.eclipse.uml2.uml.Collaboration;
 import org.eclipse.uml2.uml.Element;
@@ -204,16 +205,16 @@
     }
 
     public List<Object> getRootElements(Object model) {
-        if (model instanceof Model) {
+        if (model instanceof EObject) {
             List<Object> contents = new ArrayList<Object>();
-            contents.addAll(((Model) model).eResource().getContents());
+            contents.addAll(((EObject) model).eResource().getContents());
             if (!contents.contains(model)) {
                 contents.add(model);
             }
             return contents;
         }
         throw new IllegalArgumentException(
-                "model must be instance of Model"); //$NON-NLS-1$
+                "model must be instance of EObject"); //$NON-NLS-1$
     }
 
     public boolean isCyclicOwnership(Object parent, Object child) {

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

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.