Community
Participate
Working Groups
Add profile/stereotype support to Activity and StateMachine diagrams. Profile support is - Apply Profile/Stereotype actions - Tagged values tab in Properties View - Stereotype label
Created attachment 119455 [details] Modified dynamc templates to generate the actions and the property tab
First two items are generated. I changed the dynamic templates, the changes are in the attached patch. After diagram re-generation with this patch, the actions and the property tabs will be available. The third task, adding stereotype label, is the most labor-intensive part. In order to add a label, that displays and allows to edit applied stereotypes: 1) define a label in *.gmfgraph file: Open Figure Descriptor of the given figure. Add a Label. Make sure the stereotype label is placed _above_ the name label. Name it XXXNode_StereoLabel, then add custom layout 'org.eclipse.uml2.diagram.common.draw2d.CenterLayout'. Add Child access to the figure descriptor. Choose XXXNode_StereoLabel value for its 'figure' property. Add Diagram Label to the canvas. Name it XXXNode_stereo. Choose XXXNode_stereo value for it 'figure' property. Cjoose getFigureXXXNode_StereoLabel for its 'accessor' property. Set 'false' for 'Element Icon'. 2) create a mapping in gmfmap model: Open node mapping for the figure. Add Feature Label Mapping element as a child of the node mapping. Choose 'XXXNode_stereo' value for 'Diagram Label' property of the child. Add 'NamedElement.qualifiedName:String' value to its 'Features' property. Generate gmfgen file. 3) in gmfgen model: - rename classes: Open XXXEditPart Gen Node. Find child XXXQualifiedNameEditPart. In the properties view of the XXXQualifiedEditPart set 'XXXStereotypeEditPart' value for 'Edit part class name', 'XXXtereotypeItemSemanticEditPolicy' for ' Item Semantic Edit Policy class name', 'XXXStereotypeViewFactory' for 'Notation View Factory class name' - allow the labels to be refreshed after stereotype is applied or un-applied: Create Custom Behavior child in XXXStereotypeEditPart. Set 'org.eclipse.gef.EditPolicy.DIRECT_EDIT_ROLE' value for 'key' property, and 'org.eclipse.uml2.diagram.parser.SemanticLabelDirectEditPolicy' for 'Edit policy qualified class name'. - add custom parser Open 'Gen Parsers' element inside Gen editor. Add a Custom Parser. Set 'org.eclipse.uml2.diagram.common.parser.stereotype.AppliedStereotypeParser' value for the 'qualified class name' property of the Custom Parser. Open your 'XXXStereotypeEditPart' again. Select its child 'Feature Label Model Facet qualified name'. In the properties view of the facet choose 'org.eclipse.uml2.diagram.common.parser.stereotype.AppliedStereotypeParser' value for 'Parser' property. Re-generate the diagram.
Request came from a newsgroup post news://news.eclipse.org/6785c52673af8cb239743d423e2@news.eclipse.org
Right now it's impossible to add profile support to StateMachine diagram because content of diagram is not a package. I'm going to change content for StateMachine diagram in near future, so the request will be fixed for StateMachine diagram a bit later.
Sergey, AFAIK, you decided to add profile support to State Machine D in Galileo M4, what about Activity diagram? Michael Felderer and his team are going to implement this feature as well. Could you please provide status of this bug in order to avoid duplication of work. Besides, I think, it's make sense to separate the request into two different bugs: -Add profile support to State Machine diagram -Add profile support to Activity diagram
I'm going to implement this feature for Activity diagram within next two days. It's quite difficult task even for me, so I'm afraid it will be very difficult for Michael.
Fixed for Activity diagram. Profile support for StateMachine diagram has been extracted to separate bug 259138.