|
|
|
|
Re: Error during code generation [message #1006234 is a reply to message #1006152] |
Wed, 30 January 2013 14:31 |
Michael Golubev Messages: 383 Registered: July 2009 |
Senior Member |
|
|
Hi, Florian
I have submitted https://bugs.eclipse.org/bugs/show_bug.cgi?id=399495
I was unable to reproduce the issue with samples I have, but I have an idea of whats going wrong.
Can you please attach to bugzilla the input artifacts you have to check the fix?
If its not possible, I would ask you to
- enable dynamic templates in the GenEditorGenerator
- set the value of GenEditorGenerator#dynamicTemplatesDirectory to "/<your plugin with gmf artifacts>/templates/"
- create the folders <your plugin with gmf artifacts>/templates/aspects/xpt/editor/
- create the file DiagramEditorUtil.xpt here with text as follows:
«IMPORT 'http://www.eclipse.org/gmf/2009/GenModel'»
«EXTENSION xpt::editor::GenDiagram»
«AROUND createDocumentRootMethod FOR gmfgen::GenDiagram»
«EXPAND xpt::Common::generatedMemberComment»
private static «EXPAND MetaModel::QualifiedClassName FOR getDocumentRoot(self)» createDocumentRoot(«EXPAND MetaModel::QualifiedClassName FOR domainDiagramElement» model) {
// [1] «getDocumentRoot(self)»
// [2] «getDocumentRootSetFeature(self)»
«IF domainDiagramElement = getDocumentRoot(self)»
return model;
«ELSE»
«EXPAND MetaModel::NewInstance('docRoot') FOR getDocumentRoot(self)»
«LET getDocumentRootSetFeature(self) AS f»
«IF f.oclIsUndefined()-»
docRoot.set«domainDiagramElement.ecoreClass.name»(model); // FIXME name of the set method is pure guess«ELSE-»
«EXPAND MetaModel::modifyFeature('docRoot', getDocumentRoot(self), 'model') FOR f»«ENDIF»
«ENDLET-»
return docRoot;
«ENDIF»
}
«ENDAROUND»
- run the generation
I guess that it may solve the problem itself (let me know, I will push the fix to git then)
If the error still here, remove from this AROUND everything except the first 2 lines "// [1]..." and "// [2]...", run the generation and attach to Bugzilla the (possibly not compiliable) generated method body.
Regards,
Michael
|
|
|
|
|
|
Re: Error during code generation [message #1006279 is a reply to message #1006276] |
Wed, 30 January 2013 16:42 |
Florian W. Messages: 15 Registered: January 2013 |
Junior Member |
|
|
Hi Michael,
changing the attribute only solves the code generation problem in GMF. However, the generated EMF editor throws an error when opening documents. A workaround may be to generate the editor code first and then modify the attribute value. Perhaps, the empty name attribute in the document root is an EMF problem? I have found no way to influence the value of this attribute through ecore annotations in the XML schema.
I have prepared a sample XML schema. Maybe this helps in determining the actual problem!
Regards,
Florian
[Updated on: Thu, 31 January 2013 08:51] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.03660 seconds