set feature of stereotype [message #626227] |
Fri, 14 March 2008 11:14 |
Eclipse User |
|
|
|
Originally posted by: David.Ouagne.spim.jussieu.fr
Hi,
I need to copy the content of stereotype to new stereotype.
I have a static method which get a good result if I apply the profile.
However if the profile has already been applied, my fonction return a
Exception.
My question is: what is the difference between applying a profile and a
profile that was applied on the profile?
copy:
EObject oldEObject = oldElement.getStereotypeApplication(oldStereotype);
EObject newEObject = UMLUtil.safeApplyStereotype(newElement,
newStereotype);
for (EStructuralFeature eStructuralFeature : newEObject.eClass()
.getEAllStructuralFeatures()) {
if (!eStructuralFeature.getName()
.startsWith(Extension.METACLASS_ROLE_PREFIX)) {
if (eStructuralFeature.isChangeable())
newEObject.eSet(eStructuralFeature,
oldEObject.eGet(eStructuralFeature));
}
}
}
apply profile:
Profile profile = pck.getAppliedProfile(profileQualifiedName);
if (profile == null) {
profile = getProfile(profileURI);
pck.applyProfile(profile);
}
return profile;
|
|
|
Powered by
FUDForum. Page generated in 0.04393 seconds