Bug 477487

Summary: Declaration view background color should use same default as Source hover
Product: [Eclipse Project] JDT Reporter: Markus Keller <markus.kell.r>
Component: UIAssignee: Markus Keller <markus.kell.r>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: loskutov, markus.kell.r
Version: 4.6   
Target Milestone: 4.6 M3   
Hardware: All   
OS: All   
See Also: https://git.eclipse.org/r/56899
https://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?id=df972325ff8b7a46c89a99a5b09283a5bf975953
Whiteboard:

Description Markus Keller CLA 2015-09-15 13:07:43 EDT
The Declaration view background color defaults to COLOR_INFO_BACKGROUND. On systems with bright-on-dark tooltips, this makes the Declaration view unreadable.

From /org.eclipse.jdt.ui/plugin.xml:

      <colorDefinition
            label="%DeclarationViewBackgroundColor.label"
            categoryId="org.eclipse.jdt.ui.presentation"
            value="COLOR_INFO_BACKGROUND"
            id="org.eclipse.jdt.ui.DeclarationView.backgroundColor">

The Java source hover once had the same problem, but that was fixed using org.eclipse.jdt.internal.ui.text.java.hover.SourceViewerInformationControl#getVisibleBackgroundColor(Display).

We should move that method into org.eclipse.jdt.internal.ui.JavaUIPreferenceInitializer and then use it to initialize the DeclarationView.backgroundColor with a better color.
Comment 1 Markus Keller CLA 2015-09-15 13:21:24 EDT
(From Andrey Loskutov in bug 439884 comment #16)
> Created attachment 252653 [details]
> Open issues in N20150411-1500
Comment 2 Markus Keller CLA 2015-09-28 16:21:46 EDT
> initialize the DeclarationView.backgroundColor with a better color.

The declarative colorDefinition in the org.eclipse.ui.themes extension point is a beast. The only way to set a different default color is to use an IColorFactory, but we can't define this in org.eclipse.jdt.ui, since a colorFactory force-loads the declaring plug-in.

I'm going to cheat and just use an internal class in org.eclipse.ui.workbench. First part: http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=62d6caebc347ec5c0929dda4f7e721356ec05e6a
Comment 3 Eclipse Genie CLA 2015-09-28 16:22:31 EDT
New Gerrit change created: https://git.eclipse.org/r/56899
Comment 5 Markus Keller CLA 2015-09-30 12:18:51 EDT
.