|
Re: emf validation question [message #509398 is a reply to message #509239] |
Fri, 22 January 2010 11:23 |
Ed Merks Messages: 33140 Registered: July 2009 |
Senior Member |
|
|
This is a multi-part message in MIME format.
--------------040406030604080506050102
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
John,
Comments below.
John Ye wrote:
> I have an emf model and editor generated from a wsdl file. I don't see
> validator code generated except interfaces with comments like:
> "This doesn't really do anything, and it's not a real EMF artifact."
I'm not sure what you're referring to here.
>
> The default ValidateAction already does some work. It seems to be
> using EObjectValidator. I would like to add more validation such as
> uniqueness of keys.
If using IDs or EReference.eKeys aren't sufficient you can define your
own constraints in the model and then implement them in the generated
validator:
< http://help.eclipse.org/galil/index.jsp?topic=/org.eclipse.e mf.doc/references/overview/EMF.Validation.html>
http://help.eclipse.org/galil/index.jsp?topic=/org.eclipse.e mf.doc/references/overview/EMF.Validation.html
>
> Should I create a new EValidator and register it or use
> org.eclipse.emf.validation.constraintProviders extension?
It's possible to use the extended validation framework as well; it's not
clear you need that though.
>
> A related question is cell editor validation, for example, I want to
> prevent duplicate keys from being entered. I am using
> PropertyEditingSupport. Should I override its getCellEditor method to
> set my own ICellEditorValidator or there is better way to do it?
There isn't support within the property descriptors to do this type of
validation, so I suppose you'd need a specialized cell editor for that.
> Thanks a lot!
> John
>
>
--------------040406030604080506050102
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 7bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
John,<br>
<br>
Comments below.<br>
<br>
John Ye wrote:
<blockquote cite="mid:hja6fb$fvk$1@build.eclipse.org" type="cite">I
have an emf model and editor generated from a wsdl file. I don't see
validator code generated except interfaces with comments like: <br>
"This doesn't really do anything, and it's not a real EMF artifact."
<br>
</blockquote>
I'm not sure what you're referring to here.<br>
<blockquote cite="mid:hja6fb$fvk$1@build.eclipse.org" type="cite"><br>
The default ValidateAction already does some work. It seems to be using
EObjectValidator. I would like to add more validation such as
uniqueness of keys.
<br>
</blockquote>
If using IDs or EReference.eKeys aren't sufficient you can define your
own constraints in the model and then implement them in the generated
validator:<a
href=" http://help.eclipse.org/galil/index.jsp?topic=/org.eclipse.e mf.doc/references/overview/EMF.Validation.html"><br>
</a>
<blockquote><a
href=" http://help.eclipse.org/galil/index.jsp?topic=/org.eclipse.e mf.doc/references/overview/EMF.Validation.html"> http://help.eclipse.org/galil/index.jsp?topic=/org.eclipse.e mf.doc/references/overview/EMF.Validation.html</a><br>
</blockquote>
<blockquote cite="mid:hja6fb$fvk$1@build.eclipse.org" type="cite"><br>
Should I create a new EValidator and register it or use
org.eclipse.emf.validation.constraintProviders extension?
<br>
</blockquote>
It's possible to use the extended validation framework as well; it's
not clear you need that though.<br>
<blockquote cite="mid:hja6fb$fvk$1@build.eclipse.org" type="cite"><br>
A related question is cell editor validation, for example, I want to
prevent duplicate keys from being entered. I am using
PropertyEditingSupport. Should I override its getCellEditor method to
set my own ICellEditorValidator or there is better way to do it? <br>
</blockquote>
There isn't support within the property descriptors to do this type of
validation, so I suppose you'd need a specialized cell editor for that.<br>
<blockquote cite="mid:hja6fb$fvk$1@build.eclipse.org" type="cite">Thanks
a lot!
<br>
John
<br>
<br>
<br>
</blockquote>
</body>
</html>
--------------040406030604080506050102--
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.08030 seconds