Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Use EObjectValidator in UpdateValueStrategy
Use EObjectValidator in UpdateValueStrategy [message #896979] Fri, 20 July 2012 16:12 Go to next message
Simon Barnett is currently offline Simon BarnettFriend
Messages: 28
Registered: July 2012
Junior Member
I am trying to connect the validation methods I've defined in an EObjectValidator to an AggregationValidationStatus so that it can produce validation messages in the UI.

So far, I've got the following code when I create the binding:-

binding = bindingCtxt.bindValue(uiObs, modelObs, new EMFUpdateValueStrategy().setAfterConvertValidator(new IValidator() {
			
			@Override
			public IStatus validate(Object value) {
				/* WHAT DO I NEED TO PUT IN HERE? */
			}
		}), null);


So the question is, how do I make my EObjectValidator do the validation work for me to get the relevant messages from the model validation in the UI?

Thanks in advance.
Simon
Re: Use EObjectValidator in UpdateValueStrategy [message #897026 is a reply to message #896979] Fri, 20 July 2012 19:44 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 30692
Registered: July 2009
Senior Member
Simon,

Diagnostician.INSTANCE can be used to validate an instance.
BasicDiagnostic has static methods like toIStatus for converting a
Diagnostic to an IStatus.


On 20/07/2012 6:12 PM, Simon Barnett wrote:
> I am trying to connect the validation methods I've defined in an
> EObjectValidator to an AggregationValidationStatus so that it can
> produce validation messages in the UI.
>
> So far, I've got the following code when I create the binding:-
>
>
> binding = bindingCtxt.bindValue(uiObs, modelObs, new
> EMFUpdateValueStrategy().setAfterConvertValidator(new IValidator() {
>
> @Override
> public IStatus validate(Object value) {
> /* WHAT DO I NEED TO PUT IN HERE? */
> }
> }), null);
>
>
> So the question is, how do I make my EObjectValidator do the
> validation work for me to get the relevant messages from the model
> validation in the UI?
>
> Thanks in advance.
> Simon
Re: Use EObjectValidator in UpdateValueStrategy [message #897237 is a reply to message #897026] Mon, 23 July 2012 10:49 Go to previous message
Simon Barnett is currently offline Simon BarnettFriend
Messages: 28
Registered: July 2012
Junior Member
Ah, I knew there'd be a way!

Thanks Ed!
Previous Topic:Create Report
Next Topic:[xcore] Code Snippet ignored with derived and refers references
Goto Forum:
  


Current Time: Sun Dec 15 00:00:14 GMT 2019

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

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

Back to the top