[RFC][Icedtea-Web]: Ensure all ports entered are numeric values

Andrew Su asu at redhat.com
Mon Feb 28 14:52:28 PST 2011



----- Original Message -----
> From: "Deepak Bhole" <dbhole at redhat.com>
> To: "Andrew Su" <asu at redhat.com>
> Cc: "IcedTea" <distro-pkg-dev at openjdk.java.net>
> Sent: Monday, February 28, 2011 2:48:23 PM
> Subject: Re: [RFC][Icedtea-Web]: Ensure all ports entered are numeric values

--snip--
> >
> > Ok, I tested MaskFormatter, which does check on input, but it seems
> > to prepopulate the textfield with blank spaces. If the user clicks
> > the end of text they can't input anything. and in the even that they
> > don't enter the number of digits requested, it is deemed invalid and
> > won't record that field.
> >
> 
> Ah, that sucks.
> 
> > Similarly, when losing focus a check to see if it follow the format
> > happens and then reverts back to last valid entry. The user could
> > still enter 1 [right arrow] 2 [right arrow] etc, which of course
> > will revert to last valid entry.
> >
> 
> Okay so then I guess since check-as-you-type is not possible.
> 
> InputVerifier is probably the next best thing. You can make it show
> the
> user a dialog instead of silently changing the value back, so the user
> is more aware of the error..
> 

Here is the updated version. I did not see the need to use InputVerifier for the advanced options in the network setting tab. Reason is because there was little to verify there which could be done at time of clicking "Ok". If I were to add it in there as well, there would be need to either make a subclass of InputVerifier to reduce redundant creation of anonymous classes (which was what you wanted to avoid[creating new class]).

Comments question concerns about this patch?

Cheers,
  Andrew 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 20110228_patch1_validate_port_text_fields.patch
Type: text/x-patch
Size: 6358 bytes
Desc: not available
Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20110228/fafec29c/20110228_patch1_validate_port_text_fields.patch 


More information about the distro-pkg-dev mailing list