Loading programatically a model referring to a profile in a standalone application [message #627989] |
Fri, 16 October 2009 09:42  |
Eclipse User |
|
|
|
Hi,
I have an UML 2 Class Diagram referring to a profile.
While opening it in eclipse I can see it correctly: my classes have the stereotypes defined in the profile that I applied. While loading it programmatically I don't get them using the method getAppliedStereotypes().
I have loaded the pathmaps according to the FAQ but I don't know if I have to specify also the uml profile in the resources set. Anyway I tried to do it in this way:
addMapping(URI.createURI("platform:/resource/abc/metamodel/uwe.profile.uml "), URI.createURI("file:/D:/thesis/").appendSegment("uwe") .appendFileExtension(UMLResource.PROFILE_FILE_EXTENSION));
The addMapping method is reported:
private void addMapping(URI src, URI dest){
Map uriMap = resourcesSet.getURIConverter().getURIMap();
uriMap.put(src, dest);
System.out.println("Uri Mapping '"+src+"' -> '"+dest+"'");
}
I used the URI "platform:/resource/abc/metamodel/uwe.profile.uml" because it is the URI i see openening the model in the Eclipse (I can see the platform URI for the model itself, the one for the profile and then the list of URI for the pathmaps).
Can someone explain me what I am missing?
Federico
|
|
|
Re: Loading programatically a model referring to a profile in a standalone application [message #627999 is a reply to message #627989] |
Mon, 19 October 2009 15:33  |
Eclipse User |
|
|
|
If the profile is loaded in the same resource set as the model, it should
work.
- James.
"Federico Tomassetti" <f.tomassetti@gmail.com> wrote in message
news:hb9t85$uup$1@build.eclipse.org...
> Hi,
> I have an UML 2 Class Diagram referring to a profile.
> While opening it in eclipse I can see it correctly: my classes have the
> stereotypes defined in the profile that I applied. While loading it
> programmatically I don't get them using the method
> getAppliedStereotypes().
>
> I have loaded the pathmaps according to the FAQ but I don't know if I have
> to specify also the uml profile in the resources set. Anyway I tried to do
> it in this way:
>
> addMapping(URI.createURI("platform:/resource/abc/metamodel/uwe.profile.uml
> "), URI.createURI("file:/D:/thesis/").appendSegment("uwe")
> .appendFileExtension(UMLResource.PROFILE_FILE_EXTENSION));
>
> The addMapping method is reported:
>
> private void addMapping(URI src, URI dest){
> Map uriMap = resourcesSet.getURIConverter().getURIMap();
> uriMap.put(src, dest);
> System.out.println("Uri Mapping '"+src+"' -> '"+dest+"'");
> }
>
> I used the URI "platform:/resource/abc/metamodel/uwe.profile.uml" because
> it is the URI i see openening the model in the Eclipse (I can see the
> platform URI for the model itself, the one for the profile and then the
> list of URI for the pathmaps).
>
> Can someone explain me what I am missing?
>
> Federico
|
|
|
Powered by
FUDForum. Page generated in 0.10287 seconds