Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » JFace » databinding and EMF Validation
databinding and EMF Validation [message #657570] Thu, 03 March 2011 05:32 Go to next message
Matteo Miraz is currently offline Matteo Miraz
Messages: 38
Registered: March 2011
Member
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]

Report message to a moderator

Re: databinding and EMF Validation [message #658012 is a reply to message #657570] Fri, 04 March 2011 19:30 Go to previous messageGo to next message
Ed Merks is currently offline Ed Merks
Messages: 26014
Registered: July 2009
Senior Member
Matteo,

I imagine the answer is yes, but I'm not a data binding expert and no
doubt next you'll ask "how can I do it"?


Matteo wrote:
> 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
Re: databinding and EMF Validation [message #658239 is a reply to message #657570] Mon, 07 March 2011 09:44 Go to previous message
Thomas Schindl is currently offline Thomas Schindl
Messages: 5296
Registered: July 2009
Senior Member
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
Previous Topic:Focus listener - inconsistent behavior
Next Topic:[databinding] How to validate multiple properties cross-referenced
Goto Forum:
  


Current Time: Sun Aug 31 06:42:59 EDT 2014

Powered by FUDForum. Page generated in 0.01674 seconds