Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » JFace » [databinding] How to validate multiple properties cross-referenced
[databinding] How to validate multiple properties cross-referenced [message #657567] Thu, 03 March 2011 10:19 Go to next message
Matteo Miraz is currently offline Matteo MirazFriend
Messages: 38
Registered: March 2011
Member
Hi,

first of all, I'm a JFace newbie, so I kindly ask forgiveness if I ask a dummy question.

Suppose to have a model with three (integer) properties: a minimum value (min), a maximum value (max), and a default value (d). Obviously, these properties must satisfy the following two constraints:
(1) each of them must be a number
(2) min <= d <= max

I'm writing a JFace wizard so to allow the user to create an instance of such model.
Since I would like to provide the user with a notification about the errors in his inputs, I leverage the JFace validation framework, and I'm able to warn the user if he inserts an invalid number.

However, I'm stuck with the second constraint... how can I validate it?

Thanks,
Matteo
Re: [databinding] How to validate multiple properties cross-referenced [message #658240 is a reply to message #657567] Mon, 07 March 2011 14:47 Go to previous message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 5487
Registered: July 2009
Senior Member
As outlined in my other response you can't do this with IValidators on
the UpdateValueStrategy. The only possible solution is to implement an
IValidationStatusProvider on your DatabindingContext.

Tom

Am 03.03.11 11:19, schrieb Matteo:
> Hi,
>
> first of all, I'm a JFace newbie, so I kindly ask forgiveness if I ask a
> dummy question.
>
> Suppose to have a model with three (integer) properties: a minimum value
> (min), a maximum value (max), and a default value (d). Obviously, these
> properties must satisfy the following two constraints:
> (1) each of them must be a number
> (2) min <= d <= max
>
> I'm writing a JFace wizard so to allow the user to create an instance of
> such model. Since I would like to provide the user with a notification
> about the errors in his inputs, I leverage the JFace validation
> framework, and I'm able to warn the user if he inserts an invalid number.
> However, I'm stuck with the second constraint... how can I validate it?
>
> Thanks,
> Matteo
Previous Topic:databinding and EMF Validation
Next Topic:tableviewer header heigth
Goto Forum:
  


Current Time: Sat Dec 20 06:45:11 GMT 2014

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

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