Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Alternating colors of a single console stream.
Alternating colors of a single console stream. [message #1042578] Tue, 16 April 2013 11:53 Go to next message
Camilo Bernal is currently offline Camilo Bernal
Messages: 7
Registered: December 2012
Junior Member
Hi all,

I've created a console view which displays profiling information; each printed line containing detailed metrics. What I'm attempting to do is set the color of each line printed in the console based on the metrics (e.g. set the color of a particular line to green to show performance gain). I started with a MessageConsole, but using setColor on the MessageConsoleStream updates the whole stream, as it should.

At the moment I'm looking at consoleColorProviders extension point, but first want to make sure that this is the right approach or whether there is a better way to achieve what I described above.
Re: Alternating colors of a single console stream. [message #1043283 is a reply to message #1042578] Wed, 17 April 2013 10:04 Go to previous messageGo to next message
Camilo Bernal is currently offline Camilo Bernal
Messages: 7
Registered: December 2012
Junior Member
A more concise way to put it is: Am I going in the wrong path by attempting to set multiple colors to a single console output stream?
Re: Alternating colors of a single console stream. [message #1092263 is a reply to message #1043283] Thu, 22 August 2013 10:33 Go to previous message
Bernard SARTER is currently offline Bernard SARTER
Messages: 75
Registered: August 2011
Location: Paris, France
Member
Hi,

I faced some problems when trying to alternate the colours of a single MessageConsoleStream, so what I did to fix that was to create one MessageConsoleStream per colour:

MessageConsole msgConsole = new MessageConsole("foo", null);

MessageConsoleStream  consoleStreamDefault = msgConsole.newMessageStream();
consoleStreamDefault.setColor(null);

MessageConsoleStream  consoleStreamRed = msgConsole.newMessageStream();
consoleStreamRed.setColor(new Color(null, new RGB(255, 0, 0)));

...


a switch allows then to select the appropriate MessageConsoleStream for each single message to write.

Hope that helps,
Bernard.

Previous Topic:extension id's -- what does "fully qualified" mean? and other questions...
Next Topic:Keyboard issues
Goto Forum:
  


Current Time: Fri Aug 22 15:39:58 EDT 2014

Powered by FUDForum. Page generated in 0.01498 seconds