Skip to main content



      Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » reenable StyledText
reenable StyledText [message #479064] Sat, 08 August 2009 14:53 Go to next message
Eclipse UserFriend
I need to disable StyledText and reenable it depending on user's mouse control.

I am doing this to disable it.

final StyledText sText = new StyledText(shell, SWT.WRAP | SWT.MULTI | SWT.BORDER);

sText.setEnabled(false);

And it has FocusListener.

The problem is that when I call setEnabled(false), when it loses the focus, but it doesn't capture focus when it's disabled. Is there a way to capture focus while it's not enabled Or is there a way to not editable instead of disabling it?

Any help would be appreciated.

Thanks.
Re: reenable StyledText [message #479736 is a reply to message #479064] Wed, 12 August 2009 04:59 Go to previous messageGo to next message
Eclipse UserFriend
This can be achieved by using VerifyKeyListener on StyledText. Depending
upon your condition, if event.doit set to false, then StyledText is not
allowed for any key operation.
Re: reenable StyledText [message #481870 is a reply to message #479064] Mon, 24 August 2009 11:22 Go to previous message
Eclipse UserFriend
> The problem is that when I call setEnabled(false), when it loses the
focus, but it doesn't capture focus when it's disabled. Is there a way to
capture focus while it's not enabled Or is there a way to not editable
instead of disabling it?

sText.setEditable(false)

Grant
Previous Topic:Table with different rowheights
Next Topic:Tree without Scrollbars on Cocoa
Goto Forum:
  


Current Time: Tue Jul 01 22:55:02 EDT 2025

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

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

Back to the top