| [news.eclipse.modeling.gmf] Re: Diagram configuration option |
Hello Alex,
Nicola
Alex Shatalin wrote:
Hello Nicola,
Well, I'm not sure abot the code generated by GMF will be applicable for your custom property tab, so here we usually implement whole property tab using custom code.. If you feel it's ok to use GMF-generated content, but only change transformSelection() method it's ok.- modifying generated code to make your own PropertyTab edting corresponding property of underlying notation model elementHere I suppose I need to modify: protected Object transformSelection(Object selected)
EClassYes. In general you have to define your own .ecore model with only onebut I really have no clue of what to do. Do I have to define a new model just for the notational style? Please help.
"CustomPropertiesStyle" extending "Style" from notation.ecore. Then you can generate code for this model (i think model code is enough). Then you can use API generated by EMF to instantiate CustomPropertiesStyle and then you can assign this style to the newly created objects (using custom code in corresponding ???ViewFactory.createStyles() method).
In case you have to store some primitive type properties(String/int/boolean..)
in a notation model you can use one of existing subclasses of NamedStyle. (BooleanValueStyle/StringValueStyle) then you can skip new .ecore notation model extension definition + code generation steps.
BTW, do you really need to store these properties in a notation model? As an option you can modify domain model and introduce corresponding properties there.
----------------- Alex Shatalin