Home » Modeling » Epsilon » Emtpy Error when generating GMF tool, graph and map models
Emtpy Error when generating GMF tool, graph and map models [message #1042395] |
Tue, 16 April 2013 07:26  |
Eclipse User |
|
|
|
Hello folks
I seem to have stumbled upon an error[1] that I find strange and I was wondering if anyone could help me with it. I get it when I try to run "Eugenia->Generate GMF tool, graph and map models" on my ecore file after I have annoted it in an emf file.
The error seems to be related to PossibleValues section in my XText grammar below:
AttributeDefinition:
'*' name = ValidName '(' type = AttributeType ')'
(translations += Translation)*
(internalProperties += InternalProperty
| ( '-' externalProperties += ExternalProperty)
| ( '+' possibleValues += PossibleValues ))*
;
PossibleValues:
values += Type (',' values += Type)*
;
I know I can get rid of the error if I type
AttributeDefinition:
'*' name = ValidName '(' type = AttributeType ')'
(translations += Translation)*
(internalProperties += InternalProperty)*
( '-' externalProperties += ExternalProperty))*
( '+' possibleValues += Type (',' possibleValues += Type)*)?
;
but then I end up with a "!unique attr String[*] possibleValues;" that I seem unable to turn into a @gmf.compartment and I am unable to make it a node in the GMF diagram. (So I can only edit the values from the property window and not able to add them directly in the diagram)
So I was wondering what limits me from having the PossibleValues property that only contains a list of Type (read as string in the .emf file) and is there a way to make it so that in the emf file I can "map" a "!unique attr String[*] possibleValues;" as a node?
Thanks for any help
Write you later / Mårten
|
|
| |
Re: Emtpy Error when generating GMF tool, graph and map models [message #1043279 is a reply to message #1042531] |
Wed, 17 April 2013 09:57   |
Eclipse User |
|
|
|
Hi Dimitris
Thanks for the help, have a feeling I will have to add you and Claudio as references for my graduation paper with all the help you two give 
Have a bit paperwork that have fallen behind (its programming that is fun, not writing about it ) but I will hopefully be able to try some more at the end of the week. Had to google "polishing transformation", but always fun to learn new terms .
I tried show them with labels instead, since I mostly just want them to be shown to the user in some way, but it didn't really work the way I wanted so was wondering what I was doing wrong.
I have two attribute-based compartments so I tried to do the following:
@gmf.node(label="name, type", label.pattern="{0} ({1}))
class myNode{
... node things ...
@gmf.label(label="possibleValues, defaultValues", label.(edit.)pattern="PossibleValues: {2}, DefaultValues: {3}")
!unique attr String[*] possibleValues;
!unique attr String[*] defaultValues;
}
but it wouldn't show the string for my label inside the node. If I had text in the default node label it worked fine I only seem to get values on the second label.
Am I misusing the labels?
I guess I can use the label for the entire node but just trying to separate the name and type from the other values.
Have a nice day
Mårten
|
|
| | | |
Re: Emtpy Error when generating GMF tool, graph and map models [message #1043880 is a reply to message #1043845] |
Thu, 18 April 2013 04:14   |
Eclipse User |
|
|
|
Hi Dimitris,
It doesn't seem to work from that update either. I seem to have a skill to make things not work for me that should work .
But I tried to fiddle with the labels and I seem to have... strange behavior so I think I might have something wrong at my end. Some might be GMF related but I seem unable to use other label flags as well.
Things I noticed is:
- The label.text="DefaultText" doesnt seem to do anything
- The flag label.readOnly="true" only works for the node's label
Also found strange behavior when I try to modify the label in the diagram with delete and add (Might be GMF related):
- Adding a new item requires that I first empty the label and write only the new value, if I write the new value in the middle of the others it will generate a new value combined of all the others among the first values, i.e try to add 15 to [3, 14] I get [3, 14, [3, 14, 15]]
- Seem unable to delete values from the label in the diagram
Well, since the last parts probably is GMF related I still seem to have some issues with the gmf.label for EAttributes that shouldn't be there. Any idea what else I might take a look at?
Write you later / Mårten
|
|
| | |
Re: Emtpy Error when generating GMF tool, graph and map models [message #1043903 is a reply to message #1043358] |
Thu, 18 April 2013 04:43   |
Eclipse User |
|
|
|
Dimitris Kolovos wrote on Wed, 17 April 2013 17:50Hi Mårten,
The closest to valid Eugenia annotations would be the following:
---
@gmf.node(label="name, type", label.pattern="{0} ({1})")
class Node{
attr String name;
attr String type;
@gmf.label(label.pattern="PossibleValues: {0}")
!unique attr String[*] possibleValues;
@gmf.label(label.pattern="DefaultValues: {0}")
!unique attr String[*] defaultValues;
}
---
You know, looking at this, I was thinking.
Why not make it possible to reference directly within that label?
Let's say "type" was a reference to something defined in that model, that "type" has attributes "name" and "content". If "type.name" would be accessible directly from this label, that would in my opinion be a substantial help in designing.
What do you think, Dimitris, also about the difficulty of implementing this?
|
|
| | | | | |
Goto Forum:
Current Time: Tue Jul 22 18:08:05 EDT 2025
Powered by FUDForum. Page generated in 0.05492 seconds
|