3030import org .eclipse .jface .viewers .StyledString ;
3131import org .eclipse .jface .viewers .StyledString .Styler ;
3232import org .eclipse .search .ui .text .Match ;
33+ import org .eclipse .swt .graphics .Color ;
3334import org .eclipse .swt .graphics .Image ;
3435import org .eclipse .swt .graphics .RGB ;
3536import org .eclipse .ui .ISharedImages ;
3839
3940class ResultLabelProvider extends LabelProvider implements IStyledLabelProvider , IPropertyChangeListener {
4041
41- /**
42- *
43- */
42+ private static final String ECLIPSE_SEARCH_UI_MATCH_HIGHLIGHT = "org.eclipse.search.ui.match.highlight" ;
4443 private static final String HIGHLIGHT_COLOR_NAME = "it.unibz.instasearch.ui.HighlightColor" ;
4544 private static final String IMG_OBJ_TEXT_SEARCH_LINE = "org.eclipse.search.ui.line_match" ;
4645 private static final String MORE_RESULTS_LABEL = "More..." ;
@@ -58,7 +57,9 @@ class ResultLabelProvider extends LabelProvider implements IStyledLabelProvider,
5857 private boolean showFullPath ;
5958
6059 public ResultLabelProvider (ResultContentProvider contentProvider ) {
61- JFaceResources .getColorRegistry ().put (HIGHLIGHT_COLOR_NAME , new RGB (206 , 204 , 247 ));
60+ Color searchColor = JFaceResources .getColorRegistry ().get (ECLIPSE_SEARCH_UI_MATCH_HIGHLIGHT );
61+
62+ JFaceResources .getColorRegistry ().put (HIGHLIGHT_COLOR_NAME , (searchColor !=null ?searchColor .getRGB ():new RGB (206 , 204 , 247 )));
6263
6364 this .labelProvider = new WorkbenchLabelProvider ();
6465 this .highlightStyle = StyledString .createColorRegistryStyler (null , HIGHLIGHT_COLOR_NAME );
0 commit comments