Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » How to avoid Paste to Text widget ?
How to avoid Paste to Text widget ? [message #446300] Tue, 23 November 2004 12:32 Go to next message
jmi is currently offline jmiFriend
Messages: 84
Registered: July 2009
Member
Hi,

Is there a way to avoid Paste to a Text widget ?

I've developed a widget to edit/localize numbers and i would like to avoid
paste number because they could be too long (problem with NumberFormat
limited to 16 digit) or of bad format.

I am using the VerifyListener to check the keyword input.

Thanks

Jmi
Re: How to avoid Paste to Text widget ? [message #446307 is a reply to message #446300] Tue, 23 November 2004 14:03 Go to previous messageGo to next message
Veronika Irvine is currently offline Veronika IrvineFriend
Messages: 1272
Registered: July 2009
Senior Member
The verify listener is also invoked when text is pasted into the Text widget
so why not just verify that the pasted text matches the required format
rather than disabling paste?

"JM Delsaux" <JMDelsaux@skynet.be> wrote in message
news:cnval0$mru$1@www.eclipse.org...
> Hi,
>
> Is there a way to avoid Paste to a Text widget ?
>
> I've developed a widget to edit/localize numbers and i would like to avoid
> paste number because they could be too long (problem with NumberFormat
> limited to 16 digit) or of bad format.
>
> I am using the VerifyListener to check the keyword input.
>
> Thanks
>
> Jmi
>
Re: How to avoid Paste to Text widget ? [message #446382 is a reply to message #446307] Wed, 24 November 2004 08:04 Go to previous message
jmi is currently offline jmiFriend
Messages: 84
Registered: July 2009
Member
You're rigth, i've tried with regex and (\\d+)([.]?)(\\d*) and it's OK for
a part of the solution, i think it's the good way...

Veronika Irvine wrote:

> The verify listener is also invoked when text is pasted into the Text widget
> so why not just verify that the pasted text matches the required format
> rather than disabling paste?

> "JM Delsaux" <JMDelsaux@skynet.be> wrote in message
> news:cnval0$mru$1@www.eclipse.org...
>> Hi,
>>
>> Is there a way to avoid Paste to a Text widget ?
>>
>> I've developed a widget to edit/localize numbers and i would like to avoid
>> paste number because they could be too long (problem with NumberFormat
>> limited to 16 digit) or of bad format.
>>
>> I am using the VerifyListener to check the keyword input.
>>
>> Thanks
>>
>> Jmi
>>
Previous Topic:Toolbars
Next Topic:Always on top
Goto Forum:
  


Current Time: Tue Apr 16 14:02:29 GMT 2024

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

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

Back to the top