Community
Participate
Working Groups
Consider node A that has reference to node B with attribute C; user wants to create node mapping for A and child label mapping for attribute C; label mapping should allow to specify a way (query using ocl expression?) to navigate from A instance to B instance to obtain C value. Post in newsgroup by Marco Mosconi: Currently, only EAttributes can be selected, that are direct members of domain elements. But I need to get Label values also from EOperations or by navigating EReferences and accessing EAttributes of referenced domain elements. Can I achieve this in .gmfmap/.gmfgen or do I have to extend/customize the generated Java code? I tried to edit the gmfmap directly with something like <features href="//A/ref/b"/> to select feature 'b' from the domain element that is referenced by A through an association 'ref'. I had no luck so far ...
The display string pattern should allow for very complex labels. Consider the following. For the GMF Ecore editor, it would be nice to be able to display the following string for an EOperation with EParameters inside the EClass containment list. For example: "myOperation(p1 : Type1, p) : Type" A solution would be to allow the user to write an OCL expression to define the display string. The following is such an OCL expression which could create the above display string: let str : String = self.name.concat('(') in let length : Integer = str.size() in self.eParameters->iterate( p : EParameter; s : String = str | (if s.size() = length then s else s.concat(', ') endif) .concat(p.name).concat( (if p.eType <> null then ' : '.concat(p.eType.name) else '' endif) ) ).concat(')') .concat( (if self.eType <> null then ' : '.concat(self.eType.name) else '' endif) ) The IParser has a method, isAffectingEvent(), which returns true if the parser should refresh the display string. By using OCL a simple visitor can be created to visit the OCL exression and determine all EStructuralFeatures used in the expression. The resulting list of EStructuralFeatures could then be included in the isAffectingEvent() check. OCL is great for allowing the user to express the label display string.
(In reply to comment #1) > OCL is great for allowing the user to express the label display string. Sounds really good, OMG guys should love this :) It's a huge topic how to provide means for complex/non-direct-attribute labels, and OCL (or any language/script) comes as first choice, though it's not best fit, IMO. Text is not a model, and we can't validate/check it easily. Plus, evaluation in runtime seems bit expensive, provided you'd merely like to concatenate few values.
Version updated - not 1.0 release
I also somehow like the OCL idea, however it is cumbersome. Would it be possible to attach sth. more MDD like? Like for example a Xpand Script from oAW which perfectly supports Model-2-Text...
not 2.0
Increasing priority and adding as plan item for 2.1
Bulk update, target milestone 2.2
I really need this functionality. What I need is a little more specific: "Consider node A that has reference to node B with attribute C; user wants to create node mapping for A and child label mapping for attribute C; label mapping should allow to specify a way (query using ocl expression?) to navigate from A instance to B instance to obtain C value." In my case, the EClass A has a containment EReference to EClass B. I need to automatically create an instance of B when I create an instance of A (using "Reference New Element Spec" in the definition of Node A, for example) and add EAttribute C of the EClass B as a "Feature Label Mapping" of the Node A. Then, in the generated editor, when someone creates an instance of A and selects it's label, the properties of the automatically created instance of B should be shown in the Properties View. I don't need B as a Node, only it's properties have to be acessible in the Properties View, when selecting the label of A. I'm almost two years waiting for this GMF enhancement and trying to alter the generated Java code to implement this behaviour (any ideas of how can I do it?). Please try to release this functionality, it would be VERY nice on GMF 2.1. Sorry for the bad english and thanks for the great work on GMF!
GMFMap got ExpressionLabelMapping where one can specify expressions to represent labels. Still, parting user input and model update should be coded manually (#updateValues in the generated code) - I don't have any idea how to accomplish that with anything else, and I'd be grateful for any suggestions. In GMFGen, ExpressionLabelParser is counterpart of this new Label Mapping. Short description: http://wiki.eclipse.org/GMF_2.3_New_and_Noteworthy#2.3_M6 Tests: ParsersTest#testExpressionLabelParser
[target cleanup] 2.3 M6 was the original target milestone for this bug
[GMF Restructure] Bug 319140 : product GMF and component Models was the original product and component for this bug