Skip to content
This repository was archived by the owner on Nov 21, 2020. It is now read-only.

Commit e5fc267

Browse files
committed
Using default value for "Match highlight background color" instead of
custom.
1 parent 25dd373 commit e5fc267

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

instasearch/src/it/unibz/instasearch/ui/ResultLabelProvider.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
import org.eclipse.jface.viewers.StyledString;
3131
import org.eclipse.jface.viewers.StyledString.Styler;
3232
import org.eclipse.search.ui.text.Match;
33+
import org.eclipse.swt.graphics.Color;
3334
import org.eclipse.swt.graphics.Image;
3435
import org.eclipse.swt.graphics.RGB;
3536
import org.eclipse.ui.ISharedImages;
@@ -38,9 +39,7 @@
3839

3940
class 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

Comments
 (0)