Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » Applying UML Profile Programmatically
Applying UML Profile Programmatically [message #628517] Fri, 18 June 2010 22:51 Go to next message
Raphael  is currently offline Raphael
Messages: 8
Registered: June 2010
Junior Member
hi everybody.

i'm developing an eclipse plugin and i'm trying to apply an alread defined profile to a use case model, but i don't know how to work.

According to http://www.eclipse.org/modeling/mdt/uml2/docs/articles/Intro duction_to_UML2_Profiles/article.html I could load the package with something like the code below:

org.eclipse.uml2.uml.Package package_ = null;
try {
Resource resource = RESOURCE_SET.getResource(uri, true);

package_ = (org.eclipse.uml2.uml.Package) EcoreUtil
.getObjectByType(

resource.getContents(), UMLPackage.Literals.PACKAGE);

But, i am not understanding how to get Resource from ResourceSet. In the tutorial an instance of ResourceSet is created. I have created the profile with uml2tools and registered it in org.eclipse.uml2.uml.generated_package extension. So, how can I load an already defined Resource? I need to register it to ResourceSet object or is there another option?

thans in advance.
Re: Applying UML Profile Programmatically [message #628522 is a reply to message #628517] Mon, 21 June 2010 02:07 Go to previous message
Rafael Chaves is currently offline Rafael Chaves
Messages: 161
Registered: July 2009
Senior Member
Raphael,

This article has a section on loading/saving EMF-based models (such as UML2 models):

http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclips e.emf.doc/references/overview/EMF.html

Cheers,

Rafael
http://abstratt.com/blog
Previous Topic:Applying UML Profile Programmatically
Next Topic:UML profiles and MIWG Test Case 3
Goto Forum:
  


Current Time: Sat Sep 20 01:57:01 GMT 2014

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

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