StyledRanges [message #460891] |
Mon, 01 January 2007 12:49 |
Eclipse User |
|
|
|
Originally posted by: florianwendland.freenet.de
Hello all,
it's me again.
I have tried to follow the article about the StyledText-Widget,
especially the section concerning StyleRanges. In my app, the text
changes will be catched by a VerifiyKeyListener, send to my business
locic and than inserted by calling replaceTextRange()-method from the
StyledText.
Now, I just tried to add a test StyleRange, like this:
theEditor.replaceTextRange(offsetOfTextToBeAdd, 0, this.getContent());
final StyleRange str = new StyleRange(0,5,
new Color(PlatformUI.getWorkbench().getDisplay(), 123,7,43),
new Color(PlatformUI.getWorkbench().getDisplay(), 0,0,255));
theEditor.setStyleRange(str);
The replaceTextRange-Method works fine, but the StyleRange doesn't.
IMHO, the first 6 characters should be decorated with my style, but the
are not. I do not know, what I am doing wrong.
Hope, that someone can give me a hint.
Thx
Florian
|
|
|
Powered by
FUDForum. Page generated in 0.03348 seconds