TextViewer and change TextPresentation [message #24197] |
Sun, 26 July 2009 00:20 |
Eclipse User |
|
|
|
Another TextViewer question.
I try to change the text presentation like:
TextPresentation presentation1 = new TextPresentation();
presentation1.addStyleRange(new StyleRange(0, 10, ColorConstants.red, ColorConstants.green));
viewer.changeTextPresentation(presentation1, true);
TextPresentation presentation2 = new TextPresentation();
presentation2.addStyleRange(new StyleRange(15, 10, ColorConstants.red, ColorConstants.green));
viewer.changeTextPresentation(presentation2, true);
I would expect that the viewer would present only one style (the second one) after those calls. This
is what I understand by the word "change". But my text viewer present both styles.
I also tried to get rid of the styles by calling:
viewer.changeTextPresentation(new TextPresentation(), true);
but nothing happens ... the former styles are still there.
Why that?
Regards,
Kai
|
|
|
Powered by
FUDForum. Page generated in 0.03580 seconds