svn commit: r19106 - trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/UmlFactoryEUMLImpl.java

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: thn
Date: 2011-03-09 10:23:57-0800
New Revision: 19106

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

Log:
use getExtendPackages(...) to load standard UML2 profiles

Modified: trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/UmlFactoryEUMLImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/UmlFactoryEUMLImpl.java?view=diff&pathrev=19106&r1=19105&r2=19106
==============================================================================
--- trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/UmlFactoryEUMLImpl.java	(original)
+++ trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/UmlFactoryEUMLImpl.java	2011-03-09 10:23:57-0800
@@ -28,6 +28,7 @@
 import org.argouml.model.InvalidElementException;
 import org.argouml.model.MetaTypes;
 import org.argouml.model.UmlFactory;
+import org.eclipse.emf.common.util.URI;
 import org.eclipse.emf.ecore.EObject;
 import org.eclipse.emf.ecore.resource.Resource;
 import org.eclipse.emf.ecore.util.EcoreUtil;
@@ -702,7 +703,16 @@
     }
 
     public Collection getExtentPackages(String extentName) {
-        // TODO: Auto-generated method stub
+        if (extentName != null && extentName.startsWith("pathmap://UML_")) {
+            // trying to get a built-in standard profile from eclipse UML2
+            try {
+                URI uri = URI.createURI(extentName);
+                Resource res = UMLUtil.getResource(modelImpl, uri, true);
+                return res.getContents();
+            } catch (IllegalArgumentException ex) {
+                LOG.warn("failed to get resource: " + extentName); //$NON-NLS-1$
+            }
+        }
         return null;
     }

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

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.