Skip to main content



      Home
Home » Eclipse Projects » JFace » TextViewer and change TextPresentation
TextViewer and change TextPresentation [message #24197] Sun, 26 July 2009 00:20
Eclipse UserFriend
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
Previous Topic:TableViewer and native looking widgets
Next Topic:UpdateListStrategy validation
Goto Forum:
  


Current Time: Fri May 09 06:01:00 EDT 2025

Powered by FUDForum. Page generated in 0.03580 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top