Problem using multiple StyleRange for my StyledText [message #981617] |
Mon, 12 November 2012 10:06  |
Eclipse User |
|
|
|
I use a StyledText instance as an editor to create command files.
When keywords are recognised while the user is typing, I colorise them using a StyleRange instance.
This process works perfectly until now.
Last week, I have been asked to add line numbers in my editor (i.e. in the StyledText).
I found a way to do it using a LineStyleListener :
styledText.addLineStyleListener(new LineStyleListener() {
public void lineGetStyle(LineStyleEvent e) {
e.bulletIndex = styledText.getLineAtOffset(e.lineOffset);
StyleRange style = new StyleRange();
style.metrics = new GlyphMetrics(0, 0, Integer.toString(styledText.getLineCount() + 1).length() * 12);
e.bullet = new Bullet(ST.BULLET_NUMBER, style);
}
});
My problem now is that the colorisation does not work any more.
How can I do ?
Thanks
Helene
|
|
|
|
Powered by
FUDForum. Page generated in 0.05217 seconds