Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[platform-swt-dev] Text selection listener


Hi,
Does a listener made to listener the text selection exists in Text control ?

I've the following problem:
I'm writing an editor for Eclipse 3.2 containing lots of control including several Text.
Before wrote global action handler for cut/copy/paste, each Text control gets the Ctrl+C,Ctrl+V,... keys
but when I put global action handler in my editor Text controls don't get further the hot keys to copy/paste.
The second problem is when user click on a text field and/or select text inside it my global
actions handler must be enabled rightly (for example copy must become enabled when user select a piece of text).
This means I should be warned by Text control when user made/reset a selection to be able to enable/disable global actions.

I've tryed addSelectionListener(), but javadoc itself said that is only used to get ENTER get on aText field.

Does anyone had same problem before ?
Is there a common way to handle copy/paste along different controls as Text, Combo, and other ?

Tip:
   have method as Text.isCopyEnabled(), .isCutEnabled(), isPasteEnabled()  is a good idea.

Thanks a lot for your help.

Arnaud.

Back to the top