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

Bug 348608

Summary: [linked mode] LinkedModeUI.enableColoredLabels() doesn't work
Product: [Eclipse Project] Platform Reporter: Danail Nachev <d.nachev>
Component: TextAssignee: Danail Nachev <d.nachev>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert
Version: 3.6.2Flags: daniel_megert: review+
Target Milestone: 3.8 M5   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Straight forward patch for the bug
none
Updated patch with copyright notice daniel_megert: iplog+, daniel_megert: review+

Description Danail Nachev CLA 2011-06-07 12:40:32 EDT
LinkedModeUI.enableColoredLabels(boolean) doesn't work. When it is called, the proposals are not using the provided StyleString, but rely on the standard display string.

The problem is that the enableColoredLabels() method, just store the preference in the field, but at this point, the ContentAssistant2 is already created, so it is always created with no colors support.

The initial version of the patch (bug #223147[1]), which implemented the color support in the proposals, set the field to 'true', so it was working, but when the patch was commited, this was changed to 'false'.

[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=223147
Comment 1 Danail Nachev CLA 2011-06-07 12:41:29 EDT
Created attachment 197518 [details]
Straight forward patch for the bug

Here is a simple patch for this problem.
Comment 2 Dani Megert CLA 2011-06-08 04:46:32 EDT
Good catch Danail! The patch looks good.

Could you please attach an updated patch that adds your credentials to the copyright notice, e.g.
Dani Megert <dani@eclipse.org> - this is a bug - https://bugs.eclipse.org...

Bonus point: Provide a test case that allows to verify that colored labels indeed work.
Comment 3 Danail Nachev CLA 2011-06-08 05:02:31 EDT
Created attachment 197571 [details]
Updated patch with copyright notice

I've updated the copyright notice

Regarding the tests, I couldn't find any test which test the LinkedModeUI or related classes and I fear the that the initial effort for setting up the test will be big (I think that the test cannot run headless as the other existing tests).
Comment 4 Danail Nachev CLA 2011-06-08 05:03:08 EDT
Is there a possibility that this fix will go in 3.7.1?
Comment 5 Dani Megert CLA 2011-06-08 05:05:54 EDT
> Regarding the tests, I couldn't find any test which test the LinkedModeUI or
> related classes
Correct. There aren't any.

> and I fear the that the initial effort for setting up the test
> will be big (I think that the test cannot run headless as the other existing
> tests).
I could live with a simple test project that allows to manually verify the fix.

>Is there a possibility that this fix will go in 3.7.1?
This fix is safe. If it helps you, then I we can target 3.7.1.
Comment 6 Dani Megert CLA 2011-08-24 05:16:47 EDT
It's too late for 3.7.1 and I'm still waiting for the test project.
Comment 7 Dani Megert CLA 2011-10-31 06:00:51 EDT
> It's too late for 3.7.1 and I'm still waiting for the test project.
Danail, I'm still waiting on this.
Comment 8 Dani Megert CLA 2012-01-05 07:15:45 EST
Committed the patch with two changes:

1) updated copyright date
2) replaced "https://bugs.eclipse.org/bugs/show_bug.cgi?id=348608" with "http://bugs.eclipse.org/348608"

Fixed in master: 3abcc6a1710bfea19defbb0f6cbd9845c5fae14d