Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » [Solved] Problem to retrieve Papyrus Java profile's stereotypes(getAppliedStereotypes() returns null)
[Solved] Problem to retrieve Papyrus Java profile's stereotypes [message #1770246] Wed, 09 August 2017 10:42 Go to next message
Didier Garcin is currently offline Didier GarcinFriend
Messages: 68
Registered: April 2013
Member
Hi !

Papyrus introduces the stereotype <<External>>. My UML model built from Reverse Java had such a stereotype, applied but getAppliedStereotypes() can't see it in my eclipse plugin. It returns something like null.

Nevertheless, I have written this snippet in my plugin :

		String papyrusJavaProfileResourcePath = PapyrusJavaPackage.class.getProtectionDomain().getCodeSource().getLocation().getPath();
		try 
		{
			papyrusJavaProfileResourcePath = URLDecoder.decode(papyrusJavaProfileResourcePath, "UTF-8");
		}
		catch (UnsupportedEncodingException e) 
		{
			e.printStackTrace();
		}		
		
     URI papyrusJavaProfileResourcePluginURI = URI.createURI("jar:file:" + papyrusJavaProfileResourcePath + "!/");
		
     URI papyrusJavaProfileURI = papyrusJavaProfileResourcePluginURI.appendSegment("profiles").appendSegment("PapyrusJava.profile.uml");  
	  resourceSet.getURIConverter().getURIMap().put(URI.createURI("pathmap://PapyrusJava_PROFILES/PapyrusJava.profile.uml"), papyrusJavaProfileURI);



thanks a lot for your help. (Several days I investiigate)

[Updated on: Thu, 10 August 2017 16:18]

Report message to a moderator

Re: Problem to retrieve Papyrus Java profile's stereotypes [message #1770393 is a reply to message #1770246] Thu, 10 August 2017 16:17 Go to previous message
Didier Garcin is currently offline Didier GarcinFriend
Messages: 68
Registered: April 2013
Member
Adding the following lines, inspired by UMLResourcesUtil.initLocalRegistries() :

resourceSet.getPackageRegistry().put(PapyrusJavaPackage.eNS_URI , PapyrusJavaPackage.eINSTANCE);

UMLPlugin.getEPackageNsURIToProfileLocationMap().put(PapyrusJavaPackage.eNS_URI,
URI.createURI("pathmap://PapyrusJava_PROFILES/PapyrusJava.profile.uml#_j9REUByGEduN1bTiWJ0lyw"));


It works well.

Nevertheless, I don't know about #_j9REUByGEduN1bTiWJ0lyw.

[Updated on: Thu, 10 August 2017 16:19]

Report message to a moderator

Previous Topic:Custom Diagram Implementation
Next Topic:internalBlockDiagram.css reported as missing
Goto Forum:
  


Current Time: Thu Apr 25 06:08:21 GMT 2024

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

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

Back to the top