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 14:53 Go to next message
caesar  is currently offline caesar
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 04:59 Go to previous messageGo to next message
Praveen Missing name is currently offline Praveen Missing name
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 11:22 Go to previous message
Grant Gayed is currently offline Grant Gayed
Messages: 2148
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: Tue Jul 22 11:40:56 EDT 2014

Powered by FUDForum. Page generated in 0.02177 seconds