svn commit: r18164 - trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/FacadeEUMLImpl.java
Andreas Rueckert <[email protected]>
| Newsgroups | gmane.comp.lang.uml.argouml.cvs |
|---|---|
| Message-ID | <[email protected]> |
Author: andreas
Date: 2010-03-25 07:43:31-0700
New Revision: 18164
Modified:
trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/FacadeEUMLImpl.java
Log:
Added a getElementImports2 method, that should return ElementImport objects for importing packages.
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=18164&r1=18163&r2=18164
==============================================================================
--- 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-03-25 07:43:31-0700
@@ -621,12 +621,31 @@
}
return ((Namespace) handle).getElementImports();
}
-
+
+ /**
+ * Get all the relationsships, that represent
+ * an import of this element.
+ *
+ * @param handle The imported model element
+ */
public Collection getElementImports2(Object handle) {
if (!(handle instanceof Element)) {
throw new IllegalArgumentException();
}
- throw new NotYetImplementedException();
+
+ Collection result = new ArrayList();
+
+ // Get all the relationships, that this model element has.
+ // and filter everything, that is not an import.
+ for( Relationship rel : ((Element)handle).getRelationships()) {
+ if( (rel instanceof ElementImport)
+ && ((ElementImport)rel).getImportedElement() == handle) {
+
+ result.add( rel);
+ }
+ }
+ return result;
+ // throw new NotYetImplementedException();
}
public Collection getElementResidences(Object handle) {
------------------------------------------------------
http://argouml.tigris.org/ds/viewMessage.do?dsForumId=5905&dsMessageId=2464980
To unsubscribe from this discussion, e-mail: [[email protected]].