Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » How to delete stereotype from the persisted file?
How to delete stereotype from the persisted file? [message #626908] Tue, 09 September 2008 13:34
Eclipse UserFriend
Originally posted by: zhengxie.ie.ibm.com

Hello,

when delete a uml element, its applied stereotype is unapplied and can't
be deleted from the persisted file.

if you need more info, please read on:

A class has a stereotype application as following, by "base_Class",
its properties have stereotype applications too.

......
<packagedElement xmi:type="uml:Class" xmi:id="_2Cm51SVlEdyPG407Qktk6Q"
name="
.......
<Requirements:analytical_requirement xmi:id="_2Cm51yVlEdyPG407Qktk6Q"
bid="IBMR7243" base_Class="_2Cm51SVlEdyPG407Qktk6Q"/>
<Requirements:measure_association xmi:id="_2CwDuiVlEdyPG407Qktk6Q"
base_Property="_2CwDuCVlEdyPG407Qktk6Q"/>



after the class is destroyed by calling
((org.eclipse.uml2.uml.Element)clazz).destroy(),

the stereotype is unapplied, but the following is left in the file

<Requirements:analytical_requirement xmi:id="_2Cm51yVlEdyPG407Qktk6Q"
bid="IBMR7243"/>
<Requirements:measure_association xmi:id="_2CwDuiVlEdyPG407Qktk6Q"/>


Then I use the following code:
for (Iterator iter = element.getAppliedStereotypes().iterator();
iter.hasNext();) {
Stereotype type = (Stereotype) iter.next();
element.unapplyStereotype(type);
type.destroy();
// element.eResource().getContents().remove(type);
}

still the same result.

Can these unapplied stereotypes being deleted also?

I try to delete them from the resource, but the stereotype in the
resource is loaded as DynamicEobject...

Basicly what I need is, when delete a uml element, its applied
stereotype is unapplied and also deleted from the persisted file.

What can be done?

Thanks a million.

Jen
Previous Topic:Reverse engineering tool
Next Topic:How to delete stereotype from the persisted file?
Goto Forum:
  


Current Time: Mon Mar 30 11:22:26 GMT 2020

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

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

Back to the top