Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 334001 - Cannot change background color of dynamically created MessageConsole with setBackground()
Summary: Cannot change background color of dynamically created MessageConsole with set...
Status: RESOLVED DUPLICATE of bug 278529
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 4.1   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-Debug-Inbox CLA
QA Contact:
URL: http://i8jesus.com/stuff/misc/JyConso...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-11 11:50 EST by arshan.dabirsiaghi CLA
Modified: 2011-06-08 14:34 EDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description arshan.dabirsiaghi CLA 2011-01-11 11:50:34 EST
Build Identifier: 20090920-1017

I have a simple 200-line custom TextEditor. During a custom action ran from its context menu, I dynamically create, register and activate a MessageConsole to output the results of the action.

Before I output any data, I set the background color to black with setBackground() using a Display.getDefault().syncExec() call, but it just doesn't work. No matter where I put the call to setBackground(), it always fails. 

I tried using display.getSystemColorId() and new Color(null,0,0,0).

Reproducible: Always

Steps to Reproduce:
1. Create a TextEditor and invoke an action from it
2. In the action, create a MessageConsole
3. In a display.syncExec(), set the background color of the console to black
4. Activate the console
5. Confirm the console is not black

I will upload my simple project if allowed since it makes a simple test case.
Comment 1 arshan.dabirsiaghi CLA 2011-01-11 12:33:15 EST
Here's a URL to the project. The project is intended to be a simple Jython shell that can be invoked from a custom TextEditor. 

To see the bug in action, perform the following steps:

1. Run the project as an Eclipse plugin
2. In the second Eclipse that was started, open up a new project and a new file, test.py with the Jython Editor (use Open With->Other->Jython Editor).
3. Hit Control-R within the text editor window or right click inside the editor and hit "Run Script".
4. Confirm that the new console background is not black, despite line 157 of JythonEditor.java: 

console.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_BLACK));

This was also verified independently on Cocoa 64-bit and Helios on Vista.
Comment 2 arshan.dabirsiaghi CLA 2011-01-11 12:34:19 EST
Looks like the URL doesn't show up easily, so here it is.

http://i8jesus.com/stuff/misc/JyConsole.zip
Comment 3 arshan.dabirsiaghi CLA 2011-01-13 10:07:14 EST
Also happens on build ID 20100917-0705.
Comment 4 Felipe Heidrich CLA 2011-01-13 11:52:10 EST
I don't think this is a bug in SWT. Maybe in the Console, moving to the Debug Component (I believe they maintain the Console).
Comment 5 Pawel Piech CLA 2011-06-08 14:34:14 EDT
I believe it's duplicate.

*** This bug has been marked as a duplicate of bug 278529 ***