1 11 12 package org.eclipse.jdt.internal.ui.search; 13 14 import org.eclipse.jdt.internal.ui.JavaPluginImages; 15 import org.eclipse.search.ui.text.AbstractTextSearchViewPage; 16 import org.eclipse.swt.graphics.Image; 17 18 class OccurrencesSearchLabelProvider extends TextSearchLabelProvider { 19 20 public OccurrencesSearchLabelProvider(AbstractTextSearchViewPage page) { 21 super(page); 22 } 23 24 protected String doGetText(Object element) { 25 JavaElementLine jel= (JavaElementLine) element; 26 return jel.getLineContents().replace('\t', ' '); 27 } 28 29 public Image getImage(Object element) { 30 if (element instanceof OccurrencesGroupKey) { 31 OccurrencesGroupKey group= (OccurrencesGroupKey) element; 32 if (group.isVariable()) { 33 if (group.isWriteAccess()) 34 return JavaPluginImages.get(JavaPluginImages.IMG_OBJS_SEARCH_WRITEACCESS); 35 else 36 return JavaPluginImages.get(JavaPluginImages.IMG_OBJS_SEARCH_READACCESS); 37 } 38 39 } else if (element instanceof ExceptionOccurrencesGroupKey) { 40 ExceptionOccurrencesGroupKey group= (ExceptionOccurrencesGroupKey) element; 41 if (group.isException()) 42 return JavaPluginImages.get(JavaPluginImages.IMG_OBJS_EXCEPTION); 43 } 44 45 return JavaPluginImages.get(JavaPluginImages.IMG_OBJS_SEARCH_OCCURRENCE); 46 } 47 } 48 | Popular Tags |