databinding and EMF Validation [message #657570] |
Thu, 03 March 2011 05:32  |
Eclipse User |
|
|
|
Hi,
I need to create a wizard to create an EMF model and fill its properties. To this end, I leverage JFace to create bidings between SWT elements and EMF properties.
Now, I'm facing with user errors. The model imposes some constraints on the values of its properties, and for this reason, it is able to validate itself (following EMF's guidelines).
I would like to reuse the result of the model validation to detect errors in the user's inputs. Is it possible to do it?
Thank you in advance,
Matteo
[Updated on: Thu, 03 March 2011 05:32] by Moderator
|
|
|
|
Re: databinding and EMF Validation [message #658239 is a reply to message #657570] |
Mon, 07 March 2011 09:44  |
Eclipse User |
|
|
|
Hi,
The problem IIRC with EMF-Validation is works on top of the
Model-Instance to make the validation and so you can use it as an
IValidator because at that moment the model hasn't been synced (that's
exactly the purpose of the validator).
IIRC there've been ideas to implement this by defining a
IValidationStatusProvider on the binding context but I'm not 100% sure
if people made any progress on it.
I personally only use fairly IValidators not really often and prefer to
let the model instance get invalid because this is the only possibility
to implement cross field validation is a proper way and validating the
model before persiting has to be done anyways - no matter if Eclipse
Databinding reported an error or not.
Tom
Am 03.03.11 11:32, schrieb Matteo:
> Hi,
>
> I need to create a wizard to create an EMF model and fill its
> properties. To this end, I leverage JFace to create bidings between SWT
> elements and EMF properties.
> Now, I'm facing with user inputs. The model imposes some constraints on
> the values of its properties, and for this reason, it is able to
> validate itself (following EMF's guidelines).
>
> I would like to reuse the result of the model validation to detect
> errors in the user's inputs. Is it possible to do it?
> Thank you in advance,
> Matteo
|
|
|
Powered by
FUDForum. Page generated in 1.10121 seconds