There are a lot of events that styleText can listen to and handle using _listeners of different kinds.
How can I find out which events fired when? For example, key event, line event, paint event, and so forth. Here are the listeners available:
开发者_如何转开发addBidiSegmentListener
addExtendedModifyListener
addLineBackgroundListener
addLineStyleListener
addModifyListener
addPaintObjectListener
addSelectionListener
addVerifyKeyListener
addVerifyListener
addWordMovementListener
Thanks.
You need the "SWT Custom Controls" from the Eclipse Examples. Follow this page on how to set it up.
Then open the SWT Custom Controls view. Select the tab StyledText. Here you can select all listeners and simply try for yourself. Do something in the editor, and watch the output from the listeners. Very useful tools.
精彩评论