Skip to main content


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 12:48
Eclipse UserFriend
Originally posted by: iriss.ndsisrael.com

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()
.getActiveWorkbenchWindow().getActivePage().

showView("org.eclipse.debug.ui.ConsoleView");

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

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

doc = viewer.getDocument();

String str =
"This is plain text\n" + "This is bold text\n" + "This is red
text";
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: Sat Apr 27 00:23:36 GMT 2024

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

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

Back to the top