KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > corext > refactoring > base > JavaRefactorings


1 /*******************************************************************************
2  * Copyright (c) 2000, 2005 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.jdt.internal.corext.refactoring.base;
12
13 import org.eclipse.jdt.core.compiler.IProblem;
14
15 import org.eclipse.jdt.internal.corext.SourceRange;
16 import org.eclipse.ltk.core.refactoring.RefactoringStatus;
17 import org.eclipse.ltk.core.refactoring.RefactoringStatusContext;
18 import org.eclipse.ltk.core.refactoring.RefactoringStatusEntry;
19
20 /**
21  * Helper method to code Java refactorings
22  */

23 public class JavaRefactorings {
24
25     public static RefactoringStatusEntry createStatusEntry(IProblem problem, String JavaDoc newWcSource) {
26         RefactoringStatusContext context= new JavaStringStatusContext(newWcSource, new SourceRange(problem));
27         int severity= problem.isError() ? RefactoringStatus.ERROR: RefactoringStatus.WARNING;
28         return new RefactoringStatusEntry(severity, problem.getMessage(), context);
29     }
30 }
31
Popular Tags