Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Text-field refusing other input than integers?
Text-field refusing other input than integers? [message #460739] Tue, 06 September 2005 14:09 Go to next message
arne anka is currently offline arne ankaFriend
Messages: 133
Registered: July 2009
Senior Member
hi,
i need a text-field to check the input and refuse anything than integers.
JFace's InputDialog has IInputValidator for this purpose, but how do i
achieve that with a text-field? tried VerifyListener and ModifyListener
but with no luck.
Re: Text-field refusing other input than integers? [message #460740 is a reply to message #460739] Tue, 06 September 2005 14:40 Go to previous messageGo to next message
arne anka is currently offline arne ankaFriend
Messages: 133
Registered: July 2009
Senior Member
found a (the?) solution -- if the input does not match (regexp) set
event.doit=false.
Re: Text-field refusing other input than integers? [message #460769 is a reply to message #460739] Wed, 07 September 2005 01:09 Go to previous messageGo to next message
Steve Northover is currently offline Steve NorthoverFriend
Messages: 1636
Registered: July 2009
Senior Member
See
http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.sni ppets/src/org/eclipse/swt/snippets/Snippet19.java?rev=HEAD&a mp;content-type=text/vnd.viewcvs-markup

"arne anka" <arne.anka@ginguppin.de> wrote in message
news:op.swopmodquyrgnr@localhost...
> hi,
> i need a text-field to check the input and refuse anything than integers.
> JFace's InputDialog has IInputValidator for this purpose, but how do i
> achieve that with a text-field? tried VerifyListener and ModifyListener
> but with no luck.
Re: Text-field refusing other input than integers? [message #460788 is a reply to message #460739] Wed, 07 September 2005 07:24 Go to previous message
Pete is currently offline PeteFriend
Messages: 26
Registered: July 2009
Junior Member
There is such a thing as IntegerFieldEditor
I've never actually tried it, but is should work. :-)
Previous Topic:editing node names in a tree using TreeViewer
Next Topic:Where's the color editor from Preferences?
Goto Forum:
  


Current Time: Wed Sep 18 13:40:35 GMT 2019

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

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

Back to the top