Validation of model on doSave() [message #423547] |
Thu, 02 October 2008 03:35 |
Eclipse User |
|
|
|
Originally posted by: nuclearpsyche.gmail.com
Hello,
I have a combined EMF/GMF editor and I'm trying to have the Validation
run when the user saves the changes -- in other word I want to
automatically run the "Validate" command on the entire model from the
editor's doSave() method.
I can manually run a validation using:
Diagnostic diagnostic = Diagnostician.INSTANCE.validate(rootElement);
And it will correctly return true or false weather the model is valid or
not.
However the Problems view is not updated. What should I do in order for
the problems view to be updated?
Your help is appreciated.
tamer
|
|
|
Re: Validation of model on doSave() [message #423548 is a reply to message #423547] |
Thu, 02 October 2008 04:13 |
Eclipse User |
|
|
|
Originally posted by: cdamus.zeligsoft.com
Hi, Tamer,
The org.eclipse.emf.edit.ui.action.ValidateAction class, which
implements the "Validate" menu item, has a nested classes
EclipseResourcesUtil that it uses to create markers. It ultimately
extends a MarkerUtil class that does all of the analysis of a Diagnostic
to create problem markers.
Something in here should help you to solve your need.
HTH,
Christian
Tamer wrote:
> Hello,
>
> I have a combined EMF/GMF editor and I'm trying to have the Validation
> run when the user saves the changes -- in other word I want to
> automatically run the "Validate" command on the entire model from the
> editor's doSave() method.
>
> I can manually run a validation using:
> Diagnostic diagnostic = Diagnostician.INSTANCE.validate(rootElement);
> And it will correctly return true or false weather the model is valid or
> not.
>
> However the Problems view is not updated. What should I do in order for
> the problems view to be updated?
> Your help is appreciated.
>
> tamer
|
|
|
Powered by
FUDForum. Page generated in 0.06264 seconds