I am having some trouble trying to use property macros in the generator. I am trying to generate classes, so my target concept is ClassConcept. I want to make the class static based on some configuration. "nonStatic" is the property (of Classifier, a super concept of ClassConcept) that I need to set based on my configuration.
The problem is that I cannot set "nonStatic" in the generator. I tried the following ways, without success:
- I made my ClassConcept target in the template fragment static; clicked on "static" and tried to use intentions to add a new property macro. However, I could never get to "add new property macro". Of course, if I add a node macro, it will be for the whole node, and that's not what I need.
- I was able to add a property macro for "abstractClass" and "isFinal". That's because ClassConcept adds these two properties to Classifier and displays them in the Inspector. The inspector allows me to add a property macro by right clicking and going to the intentions menu (note that Alt-Enter won't let me add property macros). However, nonStatic is a property of Classifier, which ClassConcept does not expose in the inspector.
- I tried to open the ClassConcept node in the Node Explorer. There I could see that the other property macros were appended to the node. However, the Node Explorer does not allow for manipulating the model, only exploring it. It would be great if I could do whatever I want with the nodes there, like copying and modifying. I know this could break the model, but if you "know what you are doing..."
So, is this a bug which is not letting me add the property macro or should I do this in some other way?