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

Bug 264174

Summary: Merging to obtain 'MutatingCanvas' functionnality
Product: [Modeling] Papyrus Reporter: Patrick Tessier <Patrick.Tessier>
Component: CoreAssignee: Patrick Tessier <Patrick.Tessier>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: fjcano, gmerin, jmunoz
Version: 0.7.0Keywords: plan
Target Milestone: M1   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on:    
Bug Blocks: 264169    
Attachments:
Description Flags
mylyn/context/zip
none
mylyn/context/zip none

Description Patrick Tessier CLA 2009-02-09 08:58:31 EST
One Purprose of the template merging is to obtain 'MutatingCanvas' functionnality of MOSKitt
Comment 1 Patrick Tessier CLA 2009-02-09 09:07:36 EST
Here paste of an email about the 'MutatingCanvas' functionnality


Regarding the mutating extension to the GMF genmodel:
  this extension is used to extend the GMF genmodel with alternate types of elements for the canvas of the diagram that will be generated. GMF diagrams only support one type of element for their canvases; with this extension other types of elements can be used as elements for the canvas.

  To use the extension you have to download that project, export it as a deployable plugin and install it in the Eclipse you are going to use to develop. Once the plugin is installed in your Eclipse, you can use it to extend genmodel models. You can use the "Add extension model..." popup action to add this extension to your genmodel. In the dialog that appears, write 'platform:/plugin/es.cv.gvcase.mdt.common.gmfextension.mutating/model/mutating.ecore' in the 'Model URI' field, then press the 'Load' button. If all went well, in the 'Root Class' list you will see a bunch of elements. The root element you have to select is 'MutatingCanvas'. Click 'Finish' and your genmodel will have a new element called 'MutatingCanvas'.

  Inside this new element you can define new alternate canvases. In each alternate canvas you must define new features for TopLevelNodes and/or LinkNodes that are stored in different features than those in the original canvas.

  The dynamic-templates alerady take into account this model extension and generate code prepared to deal with different types of elements as canvas.
Comment 2 Patrick Tessier CLA 2009-02-09 10:11:07 EST
Add content of mutating canva ecore model into gmfgenextension.ecore defined in org.eclipse.papyrus.def.
In this manner, developers will manipulate only one extension GenModel.
Comment 3 Patrick Tessier CLA 2009-02-12 10:29:30 EST
Created attachment 125525 [details]
mylyn/context/zip

merge of Diagram updater.
I have checkout template of MOSKitt and added my modification
Comment 4 Patrick Tessier CLA 2009-02-16 04:59:37 EST
Created attachment 125763 [details]
mylyn/context/zip

template merged to manage mutating canva
Comment 5 Patrick Tessier CLA 2009-02-16 05:11:59 EST
merging have been done for mutating canva.
I have copied your templates of CreationNodeCommand. it will be modify to obtained following generate code: 
  
/**
* @generated
*/

protected org.eclipse.emf.ecore.EObject doDefaultElementCreation() {
org.eclipse.uml2.uml.RedefinableTemplateSignature newElement = (org.eclipse.uml2.uml.RedefinableTemplateSignature) super.doDefaultElementCreation();
//code used in MOSKitt approach in order to manage "delete from diagram"
//if (newElement != null) {
// org.eclipse.gmf.runtime.notation.Diagram diagram = es.cv.gvcase.mdt.common.util.MDTUtil.getDiagramFromRequest(getRequest());
// if (diagram != null) {
// es.cv.gvcase.mdt.common.util.MultiDiagramUtil.AddEAnnotationReferenceToDiagram(diagram, newElement);
// }
// else {
// es.cv.gvcase.mdt.common.util.MultiDiagramUtil.
// addEAnnotationReferenceToDiagram(
// org.eclipse.papyrus.diagram.clazz.part.UMLDiagramEditorPlugin.getInstance(), newElement);
// }
return newElement;
}

 I generate dead code in a first time in order to merge approaches progressively.