Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 281679

Summary: [Generative Tools] A pop-up action would be helpful to automate the creation of GenLink CustomBehavior for StereotypeLabelDisplay
Product: [Modeling] Papyrus Reporter: Yann Tanguy <yann.tanguy>
Component: CoreAssignee: Yann Tanguy <yann.tanguy>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 Keywords: plan
Version: 0.7.0   
Target Milestone: M2   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
mylyn/context/zip
none
mylyn/context/zip
none
mylyn/context/zip none

Description Yann Tanguy CLA 2009-06-26 11:29:21 EDT
The mechanism the manages applied stereotype display requires some changes in the *.gmfgen file. In particular, regarding GenLink(s), a specific EditPolicy is required. Such EditPolicy is defined in the *.gmfgen file with a CustomBehavior.

As the key and class implementing this behavior are always the same, it can be created automatically by a Pop-up Action.
Comment 1 Yann Tanguy CLA 2009-06-26 12:57:03 EDT
A pop-up menu has been added containing tools (Pop-up actions) for GMFGen modeling.

Currently a single action has been added in order to added automatically the CustomBehavior required by AppliedStereotype display mechanism.
Comment 2 Yann Tanguy CLA 2009-06-26 12:57:35 EDT
Created attachment 140261 [details]
mylyn/context/zip
Comment 3 Yann Tanguy CLA 2009-06-26 12:59:26 EDT
TODO: Check if an automated creation of the AppliedStereotype GenLinkLabel at the same time makes sense.
Comment 4 Yann Tanguy CLA 2009-06-29 12:59:56 EDT
The following action has been enhanced:
- now creates the required GenLinkLabel (for stereotype property display)
- now creates the CustomParser used for stereotype display (only in case it does not exists)

An additional action automates the VisualID setting, searching for an unused value in the model.
Comment 5 Yann Tanguy CLA 2009-06-29 12:59:58 EDT
Created attachment 140406 [details]
mylyn/context/zip
Comment 6 Yann Tanguy CLA 2009-06-29 13:16:24 EDT
We should consider moving AppliedStereotypeParser from Class diagram to Common plugin, as it will probably be used by other diagrams as well...
Comment 7 Yann Tanguy CLA 2009-06-30 05:02:23 EDT
The class used by CustomParser has moved (see bug #281959)

AddGenLinkStereotypeDisplayBehavior modified
Comment 8 Yann Tanguy CLA 2009-06-30 05:03:35 EDT
Committed in r363
Comment 9 Yann Tanguy CLA 2009-06-30 09:51:26 EDT
EditPart class name now generated XXXAppliedStereotypeEditPart instead of AppliedStereotypeXXXEditPart
Item Semantic Edit Policy Class Name now generated XXXAppliedStereotypeItemSemanticEditPolicy instead of XXXItemSemanticEditPolicy

(r365)
Comment 10 Yann Tanguy CLA 2009-06-30 09:51:29 EDT
Created attachment 140498 [details]
mylyn/context/zip
Comment 11 Yann Tanguy CLA 2009-06-30 10:50:56 EDT
AddGenLinkStereotypeDisplayBehavior assumes the concerned link is a NameElement (MetaFeature is NamedElement::name), another meta feature should be selected by hand if this is not the case (ex: Generalization).
Comment 12 Yann Tanguy CLA 2009-08-05 12:23:04 EDT
AddGenLinkStereotypeDisplayBehavior action corrected : 
-> org.eclipse.papyrus.diagram.common.parser.custom.AppliedStereotypeParser has been moved to org.eclipse.papyrus.diagram.common.parser.stereotype.AppliedStereotypeParser
Comment 13 Yann Tanguy CLA 2009-09-18 08:32:45 EDT
Done.