[Databinding] using ValidationStatusProvider to link external validation framework [message #331772] |
Sun, 21 September 2008 19:03 |
Eclipse User |
|
|
|
Originally posted by: zx.code9.com
So here is my use case.
(1) I have some Java beans that act as model code.
(2) Databinding is used to bind the model some some UI widgets
(3) Databinding is also used to do validation
(4) There is also an external "global" validator that is used to do
validation to simplify the pain of writing validators for users. This
was done mainly to handle the complexities of validation when it is
across bindings... that is... you have elements that depend on each
other. I believe this could be done with MultiValidator in Databinding,
but we are trying hard to hide any Databinding code from developers.
I was looking at linking this "ICustomValidator" with databinding to
have one unified front of managing interactions. I believe this is
possible via ValidationStatusProvider but things are a bit tricky.
Any advice how to tackle this problem? Was anything done in EMF
Databinding to link EMF Validators with databinding?
This problem is slightly similar to what Riena is trying to with its
"Ridgets"
http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.riena/o rg.eclipse.riena.sample.snippets/src/org/eclipse/riena/sampl e/snippets/SnippetTextRidget001.java?root=RT_Project&vie w=markup
We are trying to prevent users from writing complex databinding if they
don't have to.
|
|
|
Re: [Databinding] using ValidationStatusProvider to link external validation framework [message #331773 is a reply to message #331772] |
Sun, 21 September 2008 19:45 |
Ed Merks Messages: 33235 Registered: July 2009 |
Senior Member |
|
|
This is a multi-part message in MIME format.
--------------020107080908040302060807
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Chris,
In EMF you can defined name constraints on EClassifiers (EClasses and
EDataTypes). Things like the facet constraints on simple types from XML
Schema are directly supported and you can add your own hand-implemented
named constraints:
http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclips e.emf.doc/references/overview/EMF.Validation.html
I'll bet it wouldn't be hard to hook up things like
Diagnostician.INSTANCE.validate to the data binding stuff. I'd be happy
to help explore that for the 2.5 release. Right now things like
EMFUpdateValueStrategy just help with the conversion from a String to a
value, which will yield messages about conversion problems, but it would
be interesting to ensure that the constraints are also enforce. E.g.,
10 might be a valid integer, but if the values are constrained to be > 2
and < 9 then it's still wrong...
Chris Aniszczyk wrote:
> So here is my use case.
>
> (1) I have some Java beans that act as model code.
> (2) Databinding is used to bind the model some some UI widgets
> (3) Databinding is also used to do validation
> (4) There is also an external "global" validator that is used to do
> validation to simplify the pain of writing validators for users. This
> was done mainly to handle the complexities of validation when it is
> across bindings... that is... you have elements that depend on each
> other. I believe this could be done with MultiValidator in
> Databinding, but we are trying hard to hide any Databinding code from
> developers.
>
> I was looking at linking this "ICustomValidator" with databinding to
> have one unified front of managing interactions. I believe this is
> possible via ValidationStatusProvider but things are a bit tricky.
>
> Any advice how to tackle this problem? Was anything done in EMF
> Databinding to link EMF Validators with databinding?
>
> This problem is slightly similar to what Riena is trying to with its
> "Ridgets"
>
> http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.riena/o rg.eclipse.riena.sample.snippets/src/org/eclipse/riena/sampl e/snippets/SnippetTextRidget001.java?root=RT_Project&vie w=markup
>
>
> We are trying to prevent users from writing complex databinding if
> they don't have to.
--------------020107080908040302060807
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Chris,<br>
<br>
In EMF you can defined name constraints on EClassifiers (EClasses and
EDataTypes). Things like the facet constraints on simple types from
XML Schema are directly supported and you can add your own
hand-implemented named constraints:<br>
<blockquote><a
href=" http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclips e.emf.doc/references/overview/EMF.Validation.html"> http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclips e.emf.doc/references/overview/EMF.Validation.html</a><br>
</blockquote>
I'll bet it wouldn't be hard to hook up things like
Diagnostician.INSTANCE.validate to the data binding stuff. I'd be
happy to help explore that for the 2.5 release. Right now things like
EMFUpdateValueStrategy just help with the conversion from a String to a
value, which will yield messages about conversion problems, but it
would be interesting to ensure that the constraints are also enforce.
E.g., 10 might be a valid integer, but if the values are constrained to
be > 2 and < 9 then it's still wrong...<br>
<br>
<br>
<br>
Chris Aniszczyk wrote:
<blockquote cite="mid:gb65qm$av0$1@build.eclipse.org" type="cite">So
here is my use case.
<br>
<br>
(1) I have some Java beans that act as model code.
<br>
(2) Databinding is used to bind the model some some UI widgets
<br>
(3) Databinding is also used to do validation
<br>
(4) There is also an external "global" validator that is used to do
validation to simplify the pain of writing validators for users. This
was done mainly to handle the complexities of validation when it is
across bindings... that is... you have elements that depend on each
other. I believe this could be done with MultiValidator in Databinding,
but we are trying hard to hide any Databinding code from developers.
<br>
<br>
I was looking at linking this "ICustomValidator" with databinding to
have one unified front of managing interactions. I believe this is
possible via ValidationStatusProvider but things are a bit tricky.
<br>
<br>
Any advice how to tackle this problem? Was anything done in EMF
Databinding to link EMF Validators with databinding?
<br>
<br>
This problem is slightly similar to what Riena is trying to with its
"Ridgets"
<br>
<br>
<a class="moz-txt-link-freetext" href=" http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.riena/o rg.eclipse.riena.sample.snippets/src/org/eclipse/riena/sampl e/snippets/SnippetTextRidget001.java?root=RT_Project&vie w=markup"> http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.riena/o rg.eclipse.riena.sample.snippets/src/org/eclipse/riena/sampl e/snippets/SnippetTextRidget001.java?root=RT_Project&view=markup</a>
<br>
<br>
We are trying to prevent users from writing complex databinding if they
don't have to.
<br>
</blockquote>
</body>
</html>
--------------020107080908040302060807--
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03937 seconds