1 11 package org.eclipse.ltk.internal.ui.refactoring; 12 13 import org.eclipse.swt.graphics.Image; 14 15 import org.eclipse.jface.viewers.LabelProvider; 16 17 import org.eclipse.ltk.core.refactoring.RefactoringStatusEntry; 18 import org.eclipse.ltk.internal.ui.refactoring.util.Strings; 19 20 public class RefactoringStatusEntryLabelProvider extends LabelProvider{ 21 public String getText(Object element){ 22 return Strings.removeNewLine(((RefactoringStatusEntry)element).getMessage()); 23 } 24 public Image getImage(Object element){ 25 RefactoringStatusEntry entry= (RefactoringStatusEntry)element; 26 if (entry.isFatalError()) 27 return RefactoringPluginImages.get(RefactoringPluginImages.IMG_OBJS_REFACTORING_FATAL); 28 else if (entry.isError()) 29 return RefactoringPluginImages.get(RefactoringPluginImages.IMG_OBJS_REFACTORING_ERROR); 30 else if (entry.isWarning()) 31 return RefactoringPluginImages.get(RefactoringPluginImages.IMG_OBJS_REFACTORING_WARNING); 32 else 33 return RefactoringPluginImages.get(RefactoringPluginImages.IMG_OBJS_REFACTORING_INFO); 34 } 35 } 36 | Popular Tags |