Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Edit/Input Mask
Edit/Input Mask [message #435379] Wed, 17 August 2005 07:28 Go to next message
Eclipse UserFriend
Originally posted by: fixfix2.yahoo.fr

Hi,

How can I implement an input/edit mask for a Text ?
For example I would like to show something like "__/__/____" for a date
input and thta when the user input a date the content is not removed but
stay as a guide to input the date.

Thanks for your help.
Re: Edit/Input Mask [message #435594 is a reply to message #435379] Fri, 19 August 2005 07:02 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: fixfix2.yahoo.fr

Nobody has an issue for this problem ? A workaround if this functionality
doesn't exist yet ??
Thanks in advance ...
Re: Edit/Input Mask [message #435601 is a reply to message #435379] Fri, 19 August 2005 08:10 Go to previous messageGo to next message
Alex Blewitt is currently offline Alex BlewittFriend
Messages: 946
Registered: July 2009
Senior Member
Interesting idea. You might want to file a request for enhancement at Bugzilla (bugs.eclipse.org).

In the meantime, writing your own SWT component is probably the best way to achieve this; that way, you don't have to restrict yourself to using / characters (or even have it as one line of text).

The other approach you might try is hooking up a key listener, so that each time a key is pressed in the Text that the field is updated/replaced. For example, if the field looks like __/__/2|___ (| representing cursor location), and the user presses a '0' the text field would be updated to __/__/20|___ -- after which your post-processor could remove an extra _ and leave it with __/__/20|__ again.

Have a look at the 'addModifyListener' method of Text

http://help.eclipse.org/help30/topic/org.eclipse.platform.do c.isv/reference/api/org/eclipse/swt/widgets/Text.html#addMod ifyListener(org.eclipse.swt.events.ModifyListener)
Re: Edit/Input Mask [message #435976 is a reply to message #435379] Fri, 26 August 2005 22:57 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: dev.myriadfinancial.com

perhaps this would help too...

http://www.java2s.com/ExampleCode/SWT-JFace-Eclipse/Verifyin putformatfordate.htm


FIx wrote:
> Hi,
>
> How can I implement an input/edit mask for a Text ?
> For example I would like to show something like "__/__/____" for a date
> input and thta when the user input a date the content is not removed but
> stay as a guide to input the date.
>
> Thanks for your help.
>
>
Re: Edit/Input Mask [message #435977 is a reply to message #435379] Sat, 27 August 2005 00:08 Go to previous message
James Leotta is currently offline James LeottaFriend
Messages: 202
Registered: July 2009
Senior Member
http://sourceforge.net/projects/essentialdata

The above link is for an open source project that will create any mask
and do verification.

FIx wrote:
> Hi,
>
> How can I implement an input/edit mask for a Text ?
> For example I would like to show something like "__/__/____" for a date
> input and thta when the user input a date the content is not removed but
> stay as a guide to input the date.
>
> Thanks for your help.
>
>
Previous Topic:ActionBarAdvisor with ActionSets failing to load actions
Next Topic:How to access a class in my exported RCP application ?
Goto Forum:
  


Current Time: Sat Dec 14 10:36:00 GMT 2024

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

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

Back to the top