diff options
Diffstat (limited to 'plugins/toolsmiths/assistants/org.eclipse.papyrus.uml.profile.types.generator/src/org/eclipse/papyrus/uml/profile/types')
3 files changed, 12 insertions, 7 deletions
diff --git a/plugins/toolsmiths/assistants/org.eclipse.papyrus.uml.profile.types.generator/src/org/eclipse/papyrus/uml/profile/types/generator/AbstractGenerator.java b/plugins/toolsmiths/assistants/org.eclipse.papyrus.uml.profile.types.generator/src/org/eclipse/papyrus/uml/profile/types/generator/AbstractGenerator.java index 3566d4242ef..aae436c4ead 100644 --- a/plugins/toolsmiths/assistants/org.eclipse.papyrus.uml.profile.types.generator/src/org/eclipse/papyrus/uml/profile/types/generator/AbstractGenerator.java +++ b/plugins/toolsmiths/assistants/org.eclipse.papyrus.uml.profile.types.generator/src/org/eclipse/papyrus/uml/profile/types/generator/AbstractGenerator.java @@ -104,13 +104,17 @@ public abstract class AbstractGenerator<I extends EObject, O extends EObject> { try { Resource output = resourceSet.createResource(outputURI); - result = generate(input, output.getContents()); // use Identifier as XML-ID. This implies that the same XML-ID is used when re-generating EObject set = output.getContents().size() > 0 ? output.getContents().get(0) : null; if (set instanceof ElementTypeSetConfiguration) { - for (ElementTypeConfiguration elemTypeConfig : ((ElementTypeSetConfiguration) set).getElementTypeConfigurations()) { + ElementTypeSetConfiguration elementTypeSet = (ElementTypeSetConfiguration) set; + String elementTypeSetId = elementTypeSet.getIdentifier(); + if (elementTypeSetId != null && elementTypeSetId.length() > 0) { + ((XMLResource) output).setID(elementTypeSet, escapeID(elementTypeSetId)); + } + for (ElementTypeConfiguration elemTypeConfig : elementTypeSet.getElementTypeConfigurations()) { String id = elemTypeConfig.getIdentifier(); if (id != null && id.length() > 0) { ((XMLResource) output).setID(elemTypeConfig, escapeID(id)); diff --git a/plugins/toolsmiths/assistants/org.eclipse.papyrus.uml.profile.types.generator/src/org/eclipse/papyrus/uml/profile/types/generator/ApplyStereotypeAdviceRule.xtend b/plugins/toolsmiths/assistants/org.eclipse.papyrus.uml.profile.types.generator/src/org/eclipse/papyrus/uml/profile/types/generator/ApplyStereotypeAdviceRule.xtend index bd8d1453084..42a000dc237 100644 --- a/plugins/toolsmiths/assistants/org.eclipse.papyrus.uml.profile.types.generator/src/org/eclipse/papyrus/uml/profile/types/generator/ApplyStereotypeAdviceRule.xtend +++ b/plugins/toolsmiths/assistants/org.eclipse.papyrus.uml.profile.types.generator/src/org/eclipse/papyrus/uml/profile/types/generator/ApplyStereotypeAdviceRule.xtend @@ -16,8 +16,10 @@ package org.eclipse.papyrus.uml.profile.types.generator import javax.inject.Inject import javax.inject.Singleton import org.eclipse.papyrus.infra.types.ElementTypeConfiguration -import org.eclipse.uml2.uml.Stereotype +import org.eclipse.papyrus.uml.types.core.advices.applystereotype.ApplyStereotypeAdviceConfiguration import org.eclipse.papyrus.uml.types.core.advices.applystereotype.ApplyStereotypeAdviceFactory +import org.eclipse.papyrus.uml.types.core.advices.applystereotype.ApplyStereotypeAdvicePackage +import org.eclipse.uml2.uml.Stereotype /** * Transformation rule for generating an {@link ApplyStereotypeAdviceConfiguration} from a UML {@link Stereotype}. @@ -33,11 +35,11 @@ class ApplyStereotypeAdviceRule { def create createApplyStereotypeAdviceConfiguration toAdviceConfiguration(Stereotype umlStereotype, ImpliedExtension umlExtension, ElementTypeConfiguration supertype) { - identifier = umlStereotype.name.toFirstLower.qualified + supertype.hintSuffix + identifier = umlStereotype.name.toFirstLower.qualified + supertype.hintSuffix +"."+ ApplyStereotypeAdvicePackage.eNAME; stereotypesToApply.add(umlStereotype.toStereotypeToApply(supertype)) target = umlExtension.toElementType(supertype) // make file more readable - description = umlStereotype.name + description = "Apply Stereotype "+umlStereotype.name } private def create createStereotypeToApply toStereotypeToApply(Stereotype umlStereotype, ElementTypeConfiguration supertype) { diff --git a/plugins/toolsmiths/assistants/org.eclipse.papyrus.uml.profile.types.generator/src/org/eclipse/papyrus/uml/profile/types/generator/ConfigurationSetRule.xtend b/plugins/toolsmiths/assistants/org.eclipse.papyrus.uml.profile.types.generator/src/org/eclipse/papyrus/uml/profile/types/generator/ConfigurationSetRule.xtend index 967761ec9f9..874556a0e25 100644 --- a/plugins/toolsmiths/assistants/org.eclipse.papyrus.uml.profile.types.generator/src/org/eclipse/papyrus/uml/profile/types/generator/ConfigurationSetRule.xtend +++ b/plugins/toolsmiths/assistants/org.eclipse.papyrus.uml.profile.types.generator/src/org/eclipse/papyrus/uml/profile/types/generator/ConfigurationSetRule.xtend @@ -20,10 +20,9 @@ import javax.inject.Singleton import org.eclipse.papyrus.infra.types.AbstractAdviceBindingConfiguration import org.eclipse.papyrus.infra.types.ElementTypeConfiguration import org.eclipse.papyrus.infra.types.ElementTypeSetConfiguration +import org.eclipse.papyrus.infra.types.ElementTypesConfigurationsFactory import org.eclipse.uml2.uml.Profile import org.eclipse.uml2.uml.UMLPackage -import org.eclipse.papyrus.infra.types.ElementTypesConfigurationsFactory -import org.eclipse.emf.ecore.xmi.XMLResource /** * Transformation rule for generating an {@link ElementTypeSetConfiguration} from a UML {@link Profile}. |