Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Visual Editor (VE) » TextViewer Console - change text presentation.,
TextViewer Console - change text presentation., [message #585153] Sun, 28 March 2004 07:48
Eclipse User
Originally posted by:

Hello ,

I'm using the console view as a viewer but I can't change the text
presentation in it.

This is my code , but again it doesn't work.

IViewPart consoleView;
TextViewer viewer;
IDocument doc ;

public MyViewer() {

//define the viewer & doc
try {
consoleView = PlatformUI.getWorkbenc()


} catch (PartInitException e1) {
// Auto-generated catch block

viewer = (TextViewer) ((AbstractDebugView) consoleView).getViewer();

doc = viewer.getDocument();

String str =
"This is plain text\n" + "This is bold text\n" + "This is red
TextPresentation style = new TextPresentation();
style.addStyleRange( new StyleRange(1, 17, null, null, SWT.BOLD));
Color red = new Color(Display.getDefault() ,255, 40, 50);
style.addStyleRange( new StyleRange(0, 16, red, null));
viewer.setDocument( doc );
viewer.changeTextPresentation(style, true);
Previous Topic:I20040325 over M8 is fine
Next Topic:Each VE window appearing in the Windows taskbar
Goto Forum:

Current Time: Thu Aug 21 02:30:45 EDT 2014

Powered by FUDForum. Page generated in 0.02238 seconds