Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 365847 - Add support to genmodel for validate on save
Summary: Add support to genmodel for validate on save
Status: NEW
Alias: None
Product: GMF-Tooling
Classification: Modeling
Component: Core (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-07 04:29 EST by Ralph Gerbig CLA
Modified: 2022-08-14 05:56 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ralph Gerbig CLA 2011-12-07 04:29:48 EST
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