Community
Participate
Working Groups
Hi all, I is often asked for automated validation on saving a diagram. We could add such a boolean property to the genmodel. I think of GenEditor or GenDiagram. I did not take a closer look on how the modified templates would look like, but I could do so if this is of interest. The templates should not be to hard to change to this case. I currently have this custom template running. «IMPORT 'http://www.eclipse.org/gmf/2009/GenModel'» «EXTENSION xpt::editor::Utils» «AROUND additions FOR gmfgen::GenEditorView-» /** * @generated */ @Override public void doSave(org.eclipse.core.runtime.IProgressMonitor progressMonitor) { xxx.diagram.part.ValidateAction.runValidation(this.getDiagram()); super.doSave(progressMonitor); } «ENDAROUND» «AROUND doSaveAs FOR gmfgen::GenEditorView-» «EXPAND xpt::Common::generatedMemberComment» public void doSaveAs() { xxx.diagram.part.ValidateAction.runValidation(this.getDiagram()); performSaveAs(new org.eclipse.core.runtime.NullProgressMonitor()); } «ENDAROUND» I think this would be needed to be extended to ask for the flag in the genmodel and the package for the Validation action will be needed to be retrieved dynamically. Ralph