1 11 12 package org.eclipse.ui.views.markers.internal; 13 14 import org.eclipse.swt.graphics.Image; 15 16 20 public class FieldId implements IField { 21 22 private String description; 23 24 private Image image; 25 26 29 public FieldId() { 30 description = MarkerMessages.description_markerId; 31 } 32 33 37 public String getDescription() { 38 return description; 39 } 40 41 45 public Image getDescriptionImage() { 46 return image; 47 } 48 49 53 public String getColumnHeaderText() { 54 return description; 55 } 56 57 61 public Image getColumnHeaderImage() { 62 return image; 63 } 64 65 69 public String getValue(Object obj) { 70 if (obj == null || !(obj instanceof ConcreteMarker)) { 71 return ""; } 73 ConcreteMarker marker = (ConcreteMarker) obj; 74 return "" + marker.getId(); } 76 77 81 public Image getImage(Object obj) { 82 return null; 83 } 84 85 89 public int compare(Object obj1, Object obj2) { 90 if (obj1 == null || obj2 == null || !(obj1 instanceof ConcreteMarker) 91 || !(obj2 instanceof ConcreteMarker)) { 92 return 0; 93 } 94 95 ConcreteMarker marker1 = (ConcreteMarker) obj1; 96 ConcreteMarker marker2 = (ConcreteMarker) obj2; 97 return (int)(marker1.getId() - marker2.getId()); 98 } 99 100 103 public int getDefaultDirection() { 104 return TableComparator.ASCENDING; 105 } 106 107 110 public int getPreferredWidth() { 111 return 0; 112 } 113 114 117 public boolean isShowing() { 118 return false; 120 } 121 122 125 public void setShowing(boolean showing) { 126 128 } 129 } 130 | Popular Tags |