Skip to main content



      Home
Home » Archived » Visual Editor (VE) » TextViewer Console - change text presentation.,
TextViewer Console - change text presentation., [message #27303] Sun, 28 March 2004 07:48 Go to next message
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);
Re: TextViewer Console - change text presentation., [message #27733 is a reply to message #27303] Sun, 28 March 2004 14:27 Go to previous message
Eclipse UserFriend
Inbar Riss wrote:
I believe you have the wrong newsgroup - this newsgroup is for users of
the Visual Editor. The newsgroup eclipse.platform or eclipse.tools.jdt
would be my guess.

- Jeff

>
> 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);
>
Re: TextViewer Console - change text presentation., [message #585210 is a reply to message #27303] Sun, 28 March 2004 14:27 Go to previous message
Eclipse UserFriend
Inbar Riss wrote:
I believe you have the wrong newsgroup - this newsgroup is for users of
the Visual Editor. The newsgroup eclipse.platform or eclipse.tools.jdt
would be my guess.

- Jeff

>
> 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:Each VE window appearing in the Windows taskbar
Next Topic:Creation failed
Goto Forum:
  


Current Time: Fri Sep 12 17:58:14 EDT 2025

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

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

Back to the top