1 11 package org.eclipse.jdt.internal.debug.ui.classpath; 12 13 import org.eclipse.debug.core.ILaunchConfiguration; 14 import org.eclipse.jdt.debug.ui.launchConfigurations.JavaClasspathTab; 15 import org.eclipse.jdt.internal.debug.ui.launcher.RuntimeClasspathEntryLabelProvider; 16 import org.eclipse.jface.viewers.IColorProvider; 17 import org.eclipse.jface.viewers.ILabelProvider; 18 import org.eclipse.jface.viewers.ILabelProviderListener; 19 import org.eclipse.swt.SWT; 20 import org.eclipse.swt.graphics.Color; 21 import org.eclipse.swt.graphics.Image; 22 import org.eclipse.swt.widgets.Display; 23 24 27 public class ClasspathLabelProvider implements ILabelProvider, IColorProvider { 28 29 private RuntimeClasspathEntryLabelProvider runtimeClasspathLabelProvider= new RuntimeClasspathEntryLabelProvider(); 30 31 34 public Image getImage(Object element) { 35 if (element instanceof ClasspathEntry) { 36 ClasspathEntry entry = (ClasspathEntry) element; 37 return runtimeClasspathLabelProvider.getImage(entry); 38 } 39 40 return JavaClasspathTab.getClasspathImage(); 41 } 42 43 46 public String getText(Object element) { 47 if (element instanceof ClasspathEntry) { 48 ClasspathEntry entry = (ClasspathEntry) element; 49 return runtimeClasspathLabelProvider.getText(entry.getDelegate()); 50 } 51 return element.toString(); 52 } 53 54 57 public Color getBackground(Object element) { 58 if (element instanceof ClasspathGroup) { 59 Display display= Display.getCurrent(); 60 return display.getSystemColor(SWT.COLOR_INFO_BACKGROUND); 61 } else if (element instanceof ClasspathEntry) { 62 63 } 64 return null; 65 } 66 67 70 public Color getForeground(Object element) { 71 return null; 72 } 73 74 77 public void addListener(ILabelProviderListener listener) { 78 } 79 80 83 public void dispose() { 84 runtimeClasspathLabelProvider.dispose(); 85 } 86 87 90 public boolean isLabelProperty(Object element, String property) { 91 return false; 92 } 93 94 97 public void removeListener(ILabelProviderListener listener) { 98 } 99 100 103 public void setLaunchConfiguration(ILaunchConfiguration configuration) { 104 runtimeClasspathLabelProvider.setLaunchConfiguration(configuration); 105 } 106 } 107 | Popular Tags |