KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > internal > dialogs > PreferenceBoldLabelProvider


1 /*******************************************************************************
2  * Copyright (c) 2005, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.ui.internal.dialogs;
12
13 import org.eclipse.jface.preference.PreferenceLabelProvider;
14 import org.eclipse.jface.viewers.IFontProvider;
15 import org.eclipse.swt.graphics.Font;
16 import org.eclipse.ui.dialogs.FilteredTree;
17 import org.eclipse.ui.dialogs.PatternFilter;
18
19 /**
20  * This PreferenceBoldLabelProvider will bold those elements which really match
21  * the search contents
22  */

23 public class PreferenceBoldLabelProvider extends PreferenceLabelProvider
24         implements IFontProvider {
25
26     private FilteredTree filterTree;
27     private PatternFilter filterForBoldElements = new PreferencePatternFilter();
28     
29     PreferenceBoldLabelProvider(FilteredTree filterTree) {
30         this.filterTree = filterTree;
31     }
32
33     public Font getFont(Object JavaDoc element) {
34         return FilteredTree.getBoldFont(element, filterTree,
35                 filterForBoldElements);
36     }
37
38 }
39
Popular Tags