KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ltk > internal > ui > refactoring > RefactoringStatusEntryLabelProvider


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

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 JavaDoc getText(Object JavaDoc element){
22             return Strings.removeNewLine(((RefactoringStatusEntry)element).getMessage());
23         }
24         public Image getImage(Object JavaDoc 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