01: /*******************************************************************************
02: * Copyright (c) 2000, 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.pde.internal.ui.elements;
11:
12: import org.eclipse.jface.viewers.LabelProvider;
13: import org.eclipse.swt.graphics.Image;
14:
15: public class ElementLabelProvider extends LabelProvider {
16: public static final ElementLabelProvider INSTANCE = new ElementLabelProvider();
17:
18: public ElementLabelProvider() {
19: super ();
20: }
21:
22: public Image getImage(Object element) {
23: if (element instanceof IPDEElement) {
24: return ((IPDEElement) element).getImage();
25: }
26: return super .getImage(element);
27: }
28:
29: public String getText(Object element) {
30: if (element instanceof IPDEElement) {
31: return ((IPDEElement) element).getLabel();
32: }
33: return super.getText(element);
34: }
35: }
|