Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/toolsmiths/assistants/org.eclipse.papyrus.uml.profile.types.generator/src/org/eclipse/papyrus/uml/profile/types/generator/UML.xtend')
-rw-r--r--plugins/toolsmiths/assistants/org.eclipse.papyrus.uml.profile.types.generator/src/org/eclipse/papyrus/uml/profile/types/generator/UML.xtend22
1 files changed, 12 insertions, 10 deletions
diff --git a/plugins/toolsmiths/assistants/org.eclipse.papyrus.uml.profile.types.generator/src/org/eclipse/papyrus/uml/profile/types/generator/UML.xtend b/plugins/toolsmiths/assistants/org.eclipse.papyrus.uml.profile.types.generator/src/org/eclipse/papyrus/uml/profile/types/generator/UML.xtend
index bfadb67d514..41c06efe620 100644
--- a/plugins/toolsmiths/assistants/org.eclipse.papyrus.uml.profile.types.generator/src/org/eclipse/papyrus/uml/profile/types/generator/UML.xtend
+++ b/plugins/toolsmiths/assistants/org.eclipse.papyrus.uml.profile.types.generator/src/org/eclipse/papyrus/uml/profile/types/generator/UML.xtend
@@ -1,5 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2014, 2015 Christian W. Damus and others.
+ * Copyright (c) 2014, 2015, 2023 Christian W. Damus and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -10,19 +10,21 @@
*
* Contributors:
* Christian W. Damus - Initial API and implementation
+ * Ansgar Radermacher - bug 582492, move to com.google.inject
*
*****************************************************************************/
package org.eclipse.papyrus.uml.profile.types.generator
-import static org.eclipse.uml2.uml.UMLPackage.Literals.*
-
-import javax.inject.Singleton
-import org.eclipse.uml2.uml.NamedElement
-import org.eclipse.uml2.uml.Stereotype
-import org.eclipse.uml2.uml.Profile
+import com.google.inject.Singleton
+import java.util.Set
import org.eclipse.emf.ecore.EClass
import org.eclipse.emf.ecore.EReference
-import java.util.Set
+import org.eclipse.uml2.uml.NamedElement
+import org.eclipse.uml2.uml.Package
+import org.eclipse.uml2.uml.Profile
+import org.eclipse.uml2.uml.Stereotype
+
+import static org.eclipse.uml2.uml.UMLPackage.Literals.*
/**
* Utility extensions for working with UML models and elements.
@@ -52,12 +54,12 @@ class UML {
element.allOwningPackages.filter(Profile).last
}
- def Iterable<ImpliedExtension> getAllExtensions(org.eclipse.uml2.uml.Package package_) {
+ def Iterable<ImpliedExtension> getAllExtensions(Package package_) {
package_.ownedTypes.filter(Stereotype).map[impliedExtensions].flatten
+ package_.nestedPackages.map[allExtensions].flatten
}
- def Iterable<Stereotype> getAllStereotypes(org.eclipse.uml2.uml.Package package_) {
+ def Iterable<Stereotype> getAllStereotypes(Package package_) {
package_.ownedTypes.filter(Stereotype)
+ package_.nestedPackages.map[allStereotypes].flatten
}

Back to the top