1 11 12 package org.eclipse.jface.viewers; 13 14 import org.eclipse.swt.graphics.Color; 15 import org.eclipse.swt.graphics.Font; 16 import org.eclipse.swt.graphics.Image; 17 18 28 public class ColumnLabelProvider extends CellLabelProvider implements 29 IFontProvider, IColorProvider, ILabelProvider { 30 31 34 public void update(ViewerCell cell) { 35 Object element = cell.getElement(); 36 cell.setText(getText(element)); 37 Image image = getImage(element); 38 cell.setImage(image); 39 cell.setBackground(getBackground(element)); 40 cell.setForeground(getForeground(element)); 41 cell.setFont(getFont(element)); 42 43 } 44 45 48 public Font getFont(Object element) { 49 return null; 50 } 51 52 55 public Color getBackground(Object element) { 56 return null; 57 } 58 59 62 public Color getForeground(Object element) { 63 return null; 64 } 65 66 67 70 public Image getImage(Object element) { 71 return null; 72 } 73 74 77 public String getText(Object element) { 78 return element == null ? "" : element.toString(); } 80 81 } 82 | Popular Tags |