1 11 package org.eclipse.debug.internal.ui.views; 12 13 import org.eclipse.debug.ui.IDebugModelPresentation; 14 import org.eclipse.jface.viewers.IColorProvider; 15 import org.eclipse.jface.viewers.IFontProvider; 16 import org.eclipse.jface.viewers.ILabelProvider; 17 import org.eclipse.jface.viewers.ILabelProviderListener; 18 import org.eclipse.swt.graphics.Color; 19 import org.eclipse.swt.graphics.Font; 20 import org.eclipse.swt.graphics.Image; 21 22 28 public class DebugViewInterimLabelProvider implements ILabelProvider, IColorProvider, IFontProvider { 29 30 33 public final static String PENDING_LABEL= "..."; 35 38 protected IDebugModelPresentation presentation; 39 40 45 public DebugViewInterimLabelProvider(IDebugModelPresentation presentation) { 46 this.presentation= presentation; 47 } 48 49 55 public IDebugModelPresentation getPresentation() { 56 return presentation; 57 } 58 61 public Image getImage(Object element) { 62 return presentation.getImage(element); 63 } 64 67 public String getText(Object element) { 68 return DebugViewInterimLabelProvider.PENDING_LABEL; 69 } 70 73 public void addListener(ILabelProviderListener listener) { 74 presentation.addListener(listener); 75 } 76 79 public void dispose() { 80 presentation.dispose(); 81 } 82 85 public boolean isLabelProperty(Object element, String property) { 86 return presentation.isLabelProperty(element, property); 87 } 88 91 public void removeListener(ILabelProviderListener listener) { 92 presentation.removeListener(listener); 93 } 94 95 98 public Color getForeground(Object element) { 99 if (presentation instanceof IColorProvider) { 100 IColorProvider colorProvider = (IColorProvider) presentation; 101 return colorProvider.getForeground(element); 102 } 103 return null; 104 } 105 106 109 public Color getBackground(Object element) { 110 if (presentation instanceof IColorProvider) { 111 IColorProvider colorProvider = (IColorProvider) presentation; 112 return colorProvider.getBackground(element); 113 } 114 return null; 115 } 116 117 120 public Font getFont(Object element) { 121 if (presentation instanceof IFontProvider) { 122 IFontProvider fontProvider = (IFontProvider) presentation; 123 return fontProvider.getFont(element); 124 } 125 return null; 126 } 127 } 128 | Popular Tags |