Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 313530

Summary: [hovering] HTMLPrinter should refresh colors if corresponding OS colors change
Product: [Eclipse Project] Platform Reporter: Markus Keller <markus.kell.r>
Component: TextAssignee: Markus Keller <markus.kell.r>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert, darin.eclipse, deepakazad, grant_gayed, raksha.vasisht
Version: 3.6Flags: daniel_megert: review+
Target Milestone: 3.6.1   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on: 317843, 321595    
Bug Blocks:    
Attachments:
Description Flags
Fix
none
Fix 2
daniel_megert: review+
Fix for 3.6.1 none

Description Markus Keller CLA 2010-05-19 10:33:29 EDT
HEAD, follow-up to bug 312966 comment 11

HTMLPrinter should refresh cached OS colors when they were changed. Should listen to the SWT.Settings event and refresh the static fields.
Comment 1 Markus Keller CLA 2010-05-19 10:39:16 EDT
Better solution: Get rid of the cache!
Use 'InfoText' as fg color and 'InfoBackground' as bg color.

Targeting 3.7, but we could also do this for 3.6. We already use
'color: InfoText' in JavadocHoverStyleSheet.css, and that worked fine so far.
Comment 2 Markus Keller CLA 2010-05-27 10:47:11 EDT
Created attachment 170197 [details]
Fix
Comment 3 Markus Keller CLA 2010-06-23 09:47:16 EDT
Fixed in HEAD.
Comment 4 Markus Keller CLA 2010-06-24 10:10:27 EDT
Reverted the change in HTMLPrinter:

1.) Didn't work on the Mac (created 2 style="..." attributes)

2.) Even with (1) fixed, InfoBackground color was not the same as the SWT tooltip bg color. On first sight, it looked like SWT.COLOR_INFO_BACKGROUND is not the OS's color. I'll investigate.

3.) Test failure in AntEditorTests#testHoverForPath(). Need to synchronize with the Ant team when a better patch is ready.
Comment 5 Markus Keller CLA 2010-06-29 05:26:59 EDT
(In reply to comment #4)
> 2.) InfoBackground color was not the same as the SWT tooltip bg color.
That's bug 317843.

Bug 318243 also indicates that it's probably best if we don't rely on InfoText and InfoBackground, since browsers seem to be unreliable in that area.
Comment 6 Markus Keller CLA 2010-07-26 10:56:25 EDT
Created attachment 175224 [details]
Fix 2

This fix refreshes the colors when the OS settings are changed.

HTMLPrinter#convertInfoTextColor(String) is not strictly necessary to fix this bug, but it will be used by bug 318243.

AntEditorTests#testHoverForPath() is not affected by this change nor by
bug 318243 (stays green).
Comment 7 Markus Keller CLA 2010-07-26 10:58:29 EDT
Fix 2 committed to HEAD.

Dani, please review for 3.6.1.
Comment 8 Dani Megert CLA 2010-07-28 01:54:50 EDT
+1 for 3.6.1.
Comment 9 Dani Megert CLA 2010-07-28 02:05:14 EDT
>HTMLPrinter#convertInfoTextColor(String) is not strictly necessary to fix this
>bug, but it will be used by bug 318243.
Review for that is in bug 318243.
Comment 10 Deepak Azad CLA 2010-08-03 10:12:20 EDT
This does not work on Ubuntu 9.04 (gtk version 2.16.1-0)
Filed bug 321595.
Comment 11 Markus Keller CLA 2010-08-17 10:49:37 EDT
*** Bug 318243 has been marked as a duplicate of this bug. ***
Comment 12 Markus Keller CLA 2010-08-17 10:51:40 EDT
Created attachment 176792 [details]
Fix for 3.6.1

Patch accumulates all changes from HEAD and also fixes bug 318243.
Comment 13 Darin Wright CLA 2010-08-17 11:11:40 EDT
Does this effect the Ant tests?
Comment 14 Markus Keller CLA 2010-08-17 11:41:26 EDT
(In reply to comment #13)
> Does this effect the Ant tests?

It doesn't affect the Ant tests (it's effectively the same code as in HEAD).
It also doesn't effect (i.e. implement) any new Ant tests ;-).
Comment 15 Dani Megert CLA 2010-08-19 02:23:26 EDT
+1 for 3.6.1 RC2.
Comment 16 Markus Keller CLA 2010-08-23 12:48:25 EDT
Released to R3_6_maintenance.
Comment 17 Raksha Vasisht CLA 2010-08-26 02:49:50 EDT
Verified for 3.6.1 RC2 with M20100825-0800 on WinXP.
Comment 18 Dani Megert CLA 2010-08-26 05:40:44 EDT
Verified on Windows 7 using M20100825-0800.