Skip to main content


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: 6651
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:Clearing cached elements in virtual table
Next Topic:databinding and EMF Validation
Goto Forum:
  


Current Time: Fri Apr 26 12:32:56 GMT 2024

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

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

Back to the top