Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » GMF with Ecore Constraints
GMF with Ecore Constraints [message #179445] Thu, 27 March 2008 19:34 Go to next message
Greg Fox is currently offline Greg FoxFriend
Messages: 39
Registered: July 2009
Member
Can someone point me in the right direction for doing validation with GMF.
I have added constaints to my EMF model using OCL.

What I need is for an error message to be displayed to the user if a
transaction fails validation. The keyboard focus should go to the field
where the user entered the error.

Our application is not file based and the X markers are not useful in our
context. I was thinking that the error message could be shown in a
tooltip. A popup dialog would be OK, but I don't know how I could get the
focus back on the field that was being edited in the diagram.

The validation needs to happen automatically for the Transaction and
cannot require the user to actively request the validation.

Is there a standard way to deal with this in GMF? I have not been able to
find any clear documentation or tutorials on how to do this.
Re: GMF with Ecore Constraints [message #179453 is a reply to message #179445] Thu, 27 March 2008 19:57 Go to previous message
Eclipse UserFriend
Originally posted by: cdamus.ca.ibm.com

Hi, Greg,

You can use the "live" evaluation mode implemented in the validation
framework component to achieve this. Try adding an IValidationListener to
the ModelValidationService. Your listener can look at the ValidationEvent
and, if its mode is EvaluationMode::LIVE, search the IStatus results until
you find one that is an IConstraintStatus with a "target" that is an object
that you can correlate to some field in your data-entry form.

HTH,

Christian


Greg Fox wrote:

> Can someone point me in the right direction for doing validation with GMF.
> I have added constaints to my EMF model using OCL.
>
> What I need is for an error message to be displayed to the user if a
> transaction fails validation. The keyboard focus should go to the field
> where the user entered the error.
>
> Our application is not file based and the X markers are not useful in our
> context. I was thinking that the error message could be shown in a
> tooltip. A popup dialog would be OK, but I don't know how I could get the
> focus back on the field that was being edited in the diagram.
>
> The validation needs to happen automatically for the Transaction and
> cannot require the user to actively request the validation.
>
> Is there a standard way to deal with this in GMF? I have not been able to
> find any clear documentation or tutorials on how to do this.
Previous Topic:Generate an XML file from the diagram editor
Next Topic:diagram editor
Goto Forum:
  


Current Time: Fri Apr 26 17:56:38 GMT 2024

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

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

Back to the top