01: /*******************************************************************************
02: * Copyright (c) 2005, 2006 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.ui.internal.dialogs;
11:
12: import org.eclipse.jface.preference.PreferenceLabelProvider;
13: import org.eclipse.jface.viewers.IFontProvider;
14: import org.eclipse.swt.graphics.Font;
15: import org.eclipse.ui.dialogs.FilteredTree;
16: import org.eclipse.ui.dialogs.PatternFilter;
17:
18: /**
19: * This PreferenceBoldLabelProvider will bold those elements which really match
20: * the search contents
21: */
22: public class PreferenceBoldLabelProvider extends
23: PreferenceLabelProvider implements IFontProvider {
24:
25: private FilteredTree filterTree;
26: private PatternFilter filterForBoldElements = new PreferencePatternFilter();
27:
28: PreferenceBoldLabelProvider(FilteredTree filterTree) {
29: this .filterTree = filterTree;
30: }
31:
32: public Font getFont(Object element) {
33: return FilteredTree.getBoldFont(element, filterTree,
34: filterForBoldElements);
35: }
36:
37: }
|