Skip to main content



      Home
Home » Modeling » EMF » Use EObjectValidator in UpdateValueStrategy
Use EObjectValidator in UpdateValueStrategy [message #896979] Fri, 20 July 2012 12:12 Go to next message
Eclipse UserFriend
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 15:44 Go to previous messageGo to next message
Eclipse UserFriend
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 06:49 Go to previous message
Eclipse UserFriend
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 Aug 31 15:32:14 EDT 2025

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

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

Back to the top