Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » reenable StyledText
reenable StyledText [message #479064] Sat, 08 August 2009 18:53 Go to next message
caesar  is currently offline caesar Friend
Messages: 6
Registered: July 2009
Junior Member
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 08:59 Go to previous messageGo to next message
Praveen Missing name is currently offline Praveen Missing nameFriend
Messages: 6
Registered: July 2009
Junior Member
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 15:22 Go to previous message
Grant Gayed is currently offline Grant GayedFriend
Messages: 2150
Registered: July 2009
Senior Member
> 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: Thu Apr 18 17:40:59 GMT 2024

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

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

Back to the top