01: /*******************************************************************************
02: * Copyright (c) 2003, 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.jface.preference;
11:
12: import org.eclipse.jface.viewers.LabelProvider;
13: import org.eclipse.swt.graphics.Image;
14:
15: /**
16: * Provides labels for <code>IPreferenceNode</code> objects.
17: *
18: * @since 3.0
19: */
20: public class PreferenceLabelProvider extends LabelProvider {
21:
22: /**
23: * @param element must be an instance of <code>IPreferenceNode</code>.
24: * @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object)
25: */
26: public String getText(Object element) {
27: return ((IPreferenceNode) element).getLabelText();
28: }
29:
30: /**
31: * @param element must be an instance of <code>IPreferenceNode</code>.
32: * @see org.eclipse.jface.viewers.ILabelProvider#getImage(java.lang.Object)
33: */
34: public Image getImage(Object element) {
35: return ((IPreferenceNode) element).getLabelImage();
36: }
37: }
|