Validate model before saving [message #1281110] |
Mon, 31 March 2014 11:20 |
Chris Apfelbeck Messages: 1 Registered: March 2014 |
Junior Member |
|
|
Hi all,
I'm developing a Graphiti plugin for Petri nets, and I want to implement a validation against certain criteria (no deadlocks, etc.).
I want the plugin to check the edited model for these criteria when the user wants to save the model. If the criteria are not matched, some kind of message should pop up and the save action should be cancelled.
So I need a "hook" to some kind of pre-save listener from where I can validate the model and if the validation fails, signal Eclipse to cancel the save action.
Any ideas how to realize this?
I already stumbled upon the so called FileModificationValidator [1], which is originally intended to be used only in team plugins (i.e. if you're working with repositories).
However, if I register my own validator via the according extension point, I get an error that only "exactly 0 or 1 validators may be registered". I don't really know why I get this error, as I am only registering 1 validator.
I'd be really glad for any ideas or hints on how to possibly realize this.
Thanks in advance,
Chris
[1] http://help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Fguide%2FresAdv_hooks.htm
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03409 seconds