Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Text field that allows only currency entry
Text field that allows only currency entry [message #454972] Tue, 03 May 2005 18:16 Go to next message
Eclipse UserFriend
Originally posted by: shorten5273.hotmail.com

I'm a new SWT / Eclipse user and I'm looking for a simple way of
creating a text entry field into which a user may enter only a dollar
amount ($46.78 for instance). I am not concerned at this point in
internationalization as this is an in-house project and will not need to
be used in non-dollar countries. My ideal widget would only allow a user
to enter numeric digits and $,.
but having the widget perform some type of validation after an entire
entry has been made would also work.

Any hints /help would be appreciated.

rs
Re: Text field that allows only currency entry [message #454976 is a reply to message #454972] Tue, 03 May 2005 19:42 Go to previous messageGo to next message
Charlie Surface is currently offline Charlie SurfaceFriend
Messages: 40
Registered: July 2009
Member
The Text widget can have a VerifyListener, which will allow you to
modify and cancel key events. Of course, you will need to implement
your own pattern matching. There may also be a JFace class which does
this, although I don't know which one.

Charlie


shorten5273 wrote:

> I'm a new SWT / Eclipse user and I'm looking for a simple way of
> creating a text entry field into which a user may enter only a dollar
> amount ($46.78 for instance). I am not concerned at this point in
> internationalization as this is an in-house project and will not need to
> be used in non-dollar countries. My ideal widget would only allow a user
> to enter numeric digits and $,.
> but having the widget perform some type of validation after an entire
> entry has been made would also work.
>
> Any hints /help would be appreciated.
>
> rs
Re: Text field that allows only currency entry [message #454982 is a reply to message #454976] Tue, 03 May 2005 21:10 Go to previous messageGo to next message
Veronika Irvine is currently offline Veronika IrvineFriend
Messages: 1272
Registered: July 2009
Senior Member
See:

http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.sni ppets/src/org/eclipse/swt/snippets/Snippet179.java?rev=HEAD& amp;content-type=text/vnd.viewcvs-markup

This snippet formats a date but the concept could be used to format
currency.

"Charlie Surface" <csurface@us.ibm.com> wrote in message
news:d58ki3$vkj$1@news.eclipse.org...
> The Text widget can have a VerifyListener, which will allow you to modify
> and cancel key events. Of course, you will need to implement your own
> pattern matching. There may also be a JFace class which does this,
> although I don't know which one.
>
> Charlie
>
>
> shorten5273 wrote:
>
>> I'm a new SWT / Eclipse user and I'm looking for a simple way of creating
>> a text entry field into which a user may enter only a dollar amount
>> ($46.78 for instance). I am not concerned at this point in
>> internationalization as this is an in-house project and will not need to
>> be used in non-dollar countries. My ideal widget would only allow a user
>> to enter numeric digits and $,.
>> but having the widget perform some type of validation after an entire
>> entry has been made would also work.
>>
>> Any hints /help would be appreciated.
>>
>> rs
Re: Text field that allows only currency entry [message #454990 is a reply to message #454972] Wed, 04 May 2005 12:39 Go to previous messageGo to next message
James Leotta is currently offline James LeottaFriend
Messages: 202
Registered: July 2009
Senior Member
shorten5273 wrote:
> I'm a new SWT / Eclipse user and I'm looking for a simple way of
> creating a text entry field into which a user may enter only a dollar
> amount ($46.78 for instance). I am not concerned at this point in
> internationalization as this is an in-house project and will not need to
> be used in non-dollar countries. My ideal widget would only allow a user
> to enter numeric digits and $,.
> but having the widget perform some type of validation after an entire
> entry has been made would also work.
>
> Any hints /help would be appreciated.
>
> rs
Try this site:
http://www.swtworkbench.com/devzone/edwiki.cgi/Essential_Dat a_Home
Re: Text field that allows only currency entry [message #455092 is a reply to message #454972] Fri, 06 May 2005 04:18 Go to previous message
Eclipse UserFriend
Originally posted by: shorten5273.hotmail.com

Thanks everyone. Good tips.
Previous Topic:Can widgets be added to a tree
Next Topic:refreshing bottom pane
Goto Forum:
  


Current Time: Thu Sep 19 02:10:40 GMT 2024

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

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

Back to the top