[eugenia] is there a way? [message #897740] |
Wed, 25 July 2012 03:55  |
Eclipse User |
|
|
|
Hello,
I am wondering if it is possible to add something like UML's stereotype (e.g. <<xxx>>) to nodes (classes) using @gmf.node annotations.
For instance, by adding something to annotation part:
@gmf.node(label="name")
class ABC {
attr String name
}
is it possible to get graphic element similar to UML's Class with stereotype?
+---------------+
+<ABC> name +
+++++++++++
+ +
+---------------+
Or, do I need to work at GMF level?
Thank you very much for your help in advance.
Akira
|
|
|
|
|
Re: [eugenia] is there a way? [message #898793 is a reply to message #898691] |
Fri, 27 July 2012 11:21   |
Eclipse User |
|
|
|
Hi Akira,
Akira Tanaka wrote on Fri, 27 July 2012 04:30Thank you very much for the response.
Why, thank you very much for your feedback! 
Akira Tanaka wrote on Fri, 27 July 2012 04:30
I tried the suggested annotation and found the following.
1) if I use "«" and "»", the character seems to be transformed into "<" and ">" (in .gmfgen) for @gmf.node.
I've tried it on a few models of my own (also using UTF-8) and it works for me. I've had a look at the code and we don't really parse the value of "label.pattern" at all, so this is a bit puzzling :-/. We just pass it over to the GMF models.
Akira Tanaka wrote on Fri, 27 July 2012 04:30
2) if I apply the same to @gmf.link, it seems they are removed (in .gmfgen) at the end.
The problem is in the documentation, actually: "label.pattern" is not supported for @gmf.link. For the time being, I've fixed the documentation on the Epsilon website. If you need this feature, could you please file a bug report for it, citing this thread?
Best regards,
Antonio
[Updated on: Sun, 29 July 2012 09:21] by Moderator
|
|
|
Re: [eugenia] is there a way? [message #898900 is a reply to message #898793] |
Sat, 28 July 2012 21:01   |
Eclipse User |
|
|
|
Hello Antonio,
Thank you for the response. I tried use of french quotations in label.pattern again, and found that the emf file was not actually processed by "Generate Ecore Model" under my eclipse setting. That is, if I had something like
@gmf.node(label="name", label.pattern="«Node» {0}")
Then, no ecore file was generated by the command. And, if I changed this to
@gmf.node(label="name", label.pattern="<<Node>> {0}")
[
Correct ecore file was generated. So the issue may be around handling of special characters in "Generate Ecore Model," or in Emfatic or ... (?). I checked this with new UTF-8 workspace and ISO-8859-1 workspace (it was the same). Probably I am missing something.
Best regards,
Akira
|
|
|
Re: [eugenia] is there a way? [message #898960 is a reply to message #898900] |
Sun, 29 July 2012 11:16   |
Eclipse User |
|
|
|
Hi Akira,
That's odd. I have tried it again, this time with the simplest .emf I could think of, and it still works fine for me.
I have attached to this message the .emf file I have used. You only need to place it inside a project and launch Eugenia by right-clicking on it and selecting "Eugenia > Generate GMF Editor". It should produce all the ECore and GMF models, and all the required code.
In any case, it seems we will need more information to track down this problem. Could you describe your environment a bit more? Here's mine:
- Latest Epsilon from SVN (revision 1917)
- Eclipse Juno 4.2.0, build ID I20120608-1400
- 64-bit Server Sun JDK 6 update 33, running on GNU/Linux (Arch Linux)
- System-wide encoding: UTF-8 (the system property "file.encoding" is "UTF-8")
- Workspace encoding: UTF-8
If I recall correctly, Japanese operating systems tend to use Shift-JIS or EUC-JP as system-wide default encodings, instead of UTF-8 or the ISO-8859 variants. I'm not sure if Emfatic is honoring the workspace encoding when producing the .ecore file from the .emf file.
Could you please check the value of "file.encoding" in "Help > About Eclipse Platform > Installation Details > Configuration"? If it's not UTF-8, you might want to change its value following these instructions:
http://stackoverflow.com/questions/361975/setting-the-default-java-character-encoding
You're welcome!
Antonio
Attachment: example.emf
(Size: 0.37KB, Downloaded 207 times)
|
|
|
|
Re: [eugenia] is there a way? [message #899196 is a reply to message #899076] |
Mon, 30 July 2012 22:02  |
Eclipse User |
|
|
|
Hello Antonio,
I was able to change file.encoding to UTF8 in eclipse config and your file was beautifully processed!
Just in case for other people who may face the same issue, here are what I did to change the character encoding setting on Mac OSX (Lion).
From Terminal:
1) JAVA_TOOL_OPTIONS='-Dfile.encoding=UTF8'
2) Did "cd" to "/your eclipse installation folder/Eclipse.app/Contents/MacOS," and edited "eclipse.ini" there to include "-Dfile.encoding=UTF8."
Thank you for your help. This tool is great.
Best regards,
Akira
|
|
|
Powered by
FUDForum. Page generated in 3.28377 seconds