1 package org.hibernate.eclipse.console.views; 2 3 4 import org.eclipse.jface.viewers.ILabelProvider; 5 import org.eclipse.jface.viewers.ILabelProviderListener; 6 import org.eclipse.swt.graphics.Image; 7 import org.hibernate.eclipse.console.utils.EclipseImages; 8 import org.hibernate.console.node.BaseNode; 9 10 public class ConfigurationsLabelProvider implements ILabelProvider { 11 12 15 public Image getImage(Object element) { 16 if (element != null && element instanceof BaseNode) { 17 return EclipseImages.getImage(((BaseNode) element).getIconName()); 18 } else { 19 return null; 20 } 21 } 22 23 26 public String getText(Object element) { 27 if (element != null && element instanceof BaseNode) { 28 String labelName = ((BaseNode) element).getName(); 29 return labelName; 30 } else { 31 return element == null ? "<<empty>>" : element.toString(); 32 } 33 } 34 35 38 public void addListener(ILabelProviderListener listener) { 39 } 40 41 44 public void dispose() { 45 } 46 47 50 public boolean isLabelProperty(Object element, String property) { 51 return false; 52 } 53 54 57 public void removeListener(ILabelProviderListener listener) { 58 } 59 60 } | Popular Tags |