Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » Delete a stereotyped element
Delete a stereotyped element [message #579135] Thu, 01 February 2007 16:37
Chokri Mraidha is currently offline Chokri MraidhaFriend
Messages: 28
Registered: July 2009
Junior Member

I want to delete programmatically a stereotyped element.

If I consider "element" as the element to remove and "umlParent" as the
container of this element, the code I have written is:

public boolean removeUMLElement(Element element, Element umlParent) {
if(umlParent instanceof Package) {
return ((Package)umlParent).getPackagedElements().remove(element);
return false;

When I execute this code on a stereotyped element the uml model is
corrupted (I cannot open it with the editor) because of the reference to
the base_Class of the stereotype was set to "/-1" in the uml file. For
example when I delete a class stereotyped "Auxiliary", I obtain the
following line in the uml file.

<Standard:Auxiliary xmi:id="_hVC6ELIREdu_W_nj_1s00w" base_Class="/-1"/>

I have tried to delete the same stereotyped element within the uml editor
and the base_Class property was removed so the model was not corrupted.

Is there a method to delete a stereotyped element? Shoul I unapply the
stereotype before destroying the element?

Previous Topic:Custom class [1..*] stereotype attribute saved as foo="/-1"
Next Topic:Source Control File Merging
Goto Forum:

Current Time: Sun Apr 05 23:56:29 GMT 2020

Powered by FUDForum. Page generated in 0.01793 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top