[ 
https://issues.apache.org/jira/browse/PIVOT-761?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13066030#comment-13066030
 ] 

dreamtangerine commented on PIVOT-761:
--------------------------------------

I create a little prototype (a proof of concept) in pivot-stuff svn repository. 
The url is 
http://svn.codespot.com/a/apache-extras.org/pivot-stuff/trunk/pivot-stuff-validation/
 you also need to checkout 
http://svn.codespot.com/a/apache-extras.org/pivot-stuff/trunk/pivot2-dependencies/.

Some interesting things :

*  constraints are annotated in the java beans.
   
* A BeanAdapterValidator (a subclass of BeanAdapter) is created for validating.

* The remaining validation stuff for pivot-core is in packages at 
org.apache.pivot.beans.constraints.

* Component class store now throws a StoreException

* Component class also has two new methods :
    
   * protected void store(Object context, String property, Object value), 
called to store that component property but as an Object.

  * protected boolean constraintViolated(ConstraintViolation ve, Component 
cmp), called when a constraint was violated form previous method trying to 
store from cmp. Default implementation is calling parent constraintViolated 
until true is returned. 

* Form class override constraintViolated and put a flag to that component. For 
now only single component can be flagged, if the offending component,for 
example is inside of a boxpane, all the boxpane is flagged. 

Also I changed Window class to allow blocking the caller  
(http://mail-archives.apache.org/mod_mbox/pivot-user/201001.mbox/%3c4b5e581d.2080...@hms.harvard.edu%3E)
 from the EDT. I think it is useful for Alert and Prompt, so Window has a new 
method called openBlocking, and also I created a BlockingEventQueue class and 
ApplicationContext.

I am open to suggestion.

That is all.

> Test a more generic Validation approach on fields and Containers (Forms, etc)
> -----------------------------------------------------------------------------
>
>                 Key: PIVOT-761
>                 URL: https://issues.apache.org/jira/browse/PIVOT-761
>             Project: Pivot
>          Issue Type: Brainstorming
>          Components: wtk
>            Reporter: Sandro Martini
>            Assignee: Sandro Martini
>            Priority: Minor
>             Fix For: 2.1
>
>
> Investigating on this field ... both on validating single fields (not only 
> text input fields) and Container (like Forms), like in JSF.
> Some reference here:
> http://apache-pivot-developers.417237.n3.nabble.com/Text-validators-td3078385.html
> General idea: put investigation code under /skunk and the minimal set of 
> interfaces and classes, and the rest outside (in a dedicated subproject, here 
> or under apache-extras).

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to