Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » JFace » System.out.println into a TableViewer
System.out.println into a TableViewer [message #1474] Wed, 06 May 2009 12:36 Go to next message
Luca D. is currently offline Luca D.Friend
Messages: 4
Registered: July 2009
Junior Member
Hi all,
is it possible to automatically redirect evetything is actually written
with System.out.println into a tableviewer?
I have an application where there are println calls in a lot of places and
I don't really know how to see all the messages in the GUI without
modifing all the code :(
Thanks!
Re: System.out.println into a TableViewer [message #1485 is a reply to message #1474] Wed, 06 May 2009 13:24 Go to previous messageGo to next message
Romain Dervaux is currently offline Romain DervauxFriend
Messages: 40
Registered: July 2009
Member
Hi

You can redirect the standard streams with System.setOut(PrintStream) &
System.setErr(PrintStream).

A research on Google with terms "redirect system.out" will give good
hints on how to do that.




Luca D. a écrit :
> Hi all,
> is it possible to automatically redirect evetything is actually written
> with System.out.println into a tableviewer?
> I have an application where there are println calls in a lot of places
> and I don't really know how to see all the messages in the GUI without
> modifing all the code :(
> Thanks!
>
Re: System.out.println into a TableViewer [message #1520 is a reply to message #1474] Wed, 06 May 2009 14:26 Go to previous messageGo to next message
Boris Bokowski is currently offline Boris BokowskiFriend
Messages: 272
Registered: July 2009
Senior Member
Luca,

Using a TableViewer would probably not a very good UI - if you just need to
see it inside of an Eclipse application instead of in the console, I would
look into using TextViewer from org.eclipse.jface.text.

Boris

"Luca D." <dan.luca@hotmail.com> wrote in message
news:c749351c3c1988097b8d60b99c4f08e8$1@www.eclipse.org...
> Hi all,
> is it possible to automatically redirect evetything is actually written
> with System.out.println into a tableviewer?
> I have an application where there are println calls in a lot of places and
> I don't really know how to see all the messages in the GUI without
> modifing all the code :(
> Thanks!
>
Re: System.out.println into a TableViewer [message #1534 is a reply to message #1520] Wed, 06 May 2009 20:24 Go to previous messageGo to next message
Luca D. is currently offline Luca D.Friend
Messages: 4
Registered: July 2009
Junior Member
Thanks for your reply.
I don't really need a TableViewer, I just mentioned that because I created
a simple RCP application with a sample view, and the wizard created a
TableViewer; however I can replace it with a TextViewer as you suggested.
I'm actually trying to reassign the output stream to the text of the
control..
Thanks to both of you for the hints.
Re: System.out.println into a TableViewer [message #1620 is a reply to message #1534] Thu, 07 May 2009 10:23 Go to previous messageGo to next message
Luca D. is currently offline Luca D.Friend
Messages: 4
Registered: July 2009
Junior Member
I think I made it work..
But the TableViewer gave me the possibility to add an icon at the
beginning of each entry, while the TextViewer does not (if I'm right).
I've taken a look at the ListViewer and neither does it do it.
Hence I returned to the TableViewer.. have I made the best choice?
Re: System.out.println into a TableViewer [message #2752 is a reply to message #1620] Thu, 07 May 2009 19:57 Go to previous message
Boris Bokowski is currently offline Boris BokowskiFriend
Messages: 272
Registered: July 2009
Senior Member
Hi Luca,

see below:

"Luca D." <dan.luca@hotmail.com> wrote in message
news:ccb97a06d0de434aaa5fd6b90e3a3b92$1@www.eclipse.org...
>I think I made it work..

:-)

> But the TableViewer gave me the possibility to add an icon at the
> beginning of each entry, while the TextViewer does not (if I'm right).
> I've taken a look at the ListViewer and neither does it do it.
> Hence I returned to the TableViewer.. have I made the best choice?

It depends - if you can live with every line being the same height, and no
wrapping, then a TableViewer might work. I could imagine it being a good fit
when the messages written out to System.out are of a pretty regular
structure.

Boris
Previous Topic:CheckBoxTreeViewer and CellEditor combination is buggy
Next Topic:"L" at the beginning of a path
Goto Forum:
  


Current Time: Wed Oct 20 01:53:55 GMT 2021

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

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

Back to the top