1 11 package org.eclipse.pde.internal.ui.elements; 12 13 import org.eclipse.jface.viewers.LabelProvider; 14 import org.eclipse.swt.graphics.Image; 15 16 public class ElementLabelProvider extends LabelProvider { 17 public static final ElementLabelProvider INSTANCE = new ElementLabelProvider(); 18 19 public ElementLabelProvider() { 20 super(); 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 public String getText(Object element) { 29 if (element instanceof IPDEElement) { 30 return ((IPDEElement)element).getLabel(); 31 } 32 return super.getText(element); 33 } 34 } 35 | Popular Tags |