Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » UML Model and fragments
UML Model and fragments [message #654935] Thu, 17 February 2011 11:42
luigiza76 is currently offline luigiza76
Messages: 1
Registered: February 2011
Junior Member
Hi,
I have to implement a plugin that selected a package inside a UML model creates its fragment (<name package>. uml).

public void save(org.eclipse.uml2.uml.Package pck, URI uri) throws IOException {
		Resource resource = _resourceSet.createResource(uri);
		resource.getContents().add(pck);
		resource.save(null);
	}


So we have the UML model and its fragments: MainModel.uml, package1.uml .... packageN.uml
Within MainModel.uml there are the references to other *.uml. For example:
  <packagedElement xmi:type="uml:Package" href="package1.uml#_2FI4IDmsEeC4o_pnPrzWXg"/>

This plugin has been implemented with success.

I have to implement also a plugin which achieves the opposite operation: selected a package package1.uml this is inserted within the MainModel.uml
  <packagedElement xmi:type="uml:Package" xmi:id="_8X8IYDmrEeC4o_pnPrzWXg" name="package1">

How can I realize this?

Thanks for the help...
Previous Topic:UML2 Instance Diagram
Next Topic:ddl generation
Goto Forum:
  


Current Time: Fri Aug 22 06:02:55 EDT 2014

Powered by FUDForum. Page generated in 0.02291 seconds