Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » Applying UML Profile Programmatically(Profile defined with UML2Tools and registered with org.eclipse.uml2.uml.generated_package extension point)
Applying UML Profile Programmatically [message #541252] Fri, 18 June 2010 18: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 #541407 is a reply to message #541252] Sun, 20 June 2010 22: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:slot defining feature
Next Topic:Applying UML Profile Programmatically
Goto Forum:
  


Current Time: Wed Aug 27 17:23:16 EDT 2014

Powered by FUDForum. Page generated in 0.08726 seconds