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

Bug 343880

Summary: DecoratingFileSearchLabelProvider uses JDT color constant
Product: [Eclipse Project] Platform Reporter: Mohamed Hussein <mohamed_hussein>
Component: SearchAssignee: Platform-Search-Inbox <platform-search-inbox>
Status: CLOSED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert
Version: 3.7   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Mohamed Hussein CLA 2011-04-26 12:00:27 EDT
Build Identifier: 

org.eclipse.search.internal.ui.text.DecoratingFileSearchLabelProvider uses a JDT constant for the highlight search color "org.eclipse.jdt.ui.ColoredLabels.match_highlight"

If you use the Search plugin in an RCP without JDT you will not get highlights.

The irony is that the JDT constant just refers to the constant in the search plugin:

 <colorDefinition
	            label="%coloredLabels.match_highlight.label"
	            categoryId="org.eclipse.jdt.ui.presentation"
	            defaultsTo="org.eclipse.search.ui.match.highlight"
	            id="org.eclipse.jdt.ui.ColoredLabels.match_highlight">
	         <description>
	            %coloredLabels.match_highlight.description
	         </description>

The actual color is in the search plugin itself
      <colorDefinition
	         label="%match_highlight.label"
	         categoryId="org.eclipse.ui.workbenchMisc"
	         value="206,204,247"
	         id="org.eclipse.search.ui.match.highlight">
	         <description>
	            %match_highlight.description
	         </description>
	      </colorDefinition>
To get highlight working I had to redefine the JDT constant in my plugin to the actual value
<extension
              point="org.eclipse.ui.themes">
           <colorDefinition
                 id="org.eclipse.jdt.ui.ColoredLabels.match_highlight"
                 label="text color for search result"
                 value="206,204,247">
           </colorDefinition>
        </extension>
A weird thing is that when I used the defaultsTo it gave me black background??


Reproducible: Always

Steps to Reproduce:
1. Create RCP application with projects and Search but no JDT dependency :-)
2. Search for text
3. You will not get highlight in the search result view
Comment 1 Dani Megert CLA 2011-04-26 12:02:15 EDT

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