Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Validation of model on doSave()
Validation of model on doSave() [message #423547] Thu, 02 October 2008 03:35 Go to next message
Eclipse UserFriend
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 Go to previous message
Eclipse UserFriend
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
Previous Topic:[CDO] legacy model support
Next Topic:Extending/overriding the generated EMF model
Goto Forum:
  


Current Time: Thu Mar 28 23:09:31 GMT 2024

Powered by FUDForum. Page generated in 0.06264 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top