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.jdt.internal.corext.fix; 12 13 import org.eclipse.core.runtime.CoreException; 14 import org.eclipse.core.runtime.IStatus; 15 16 import org.eclipse.ltk.core.refactoring.TextChange; 17 18 import org.eclipse.jdt.core.ICompilationUnit; 19 20 /** 21 * An <code>IFix</code> can calculate a <code>TextChange</code> 22 * which applied to a <code>ICompilationUnit</code> will fix 23 * one or several problems. 24 * 25 * @since 3.2 26 */ 27 public interface IFix { 28 29 /** 30 * A String describing what the <code>TextChange</code> returned by 31 * <code>createChange</code> will do. 32 * 33 * @return The description, not null 34 */ 35 public abstract String getDescription(); 36 37 /** 38 * A <code>TextChange</code> which applied to <code>getCompilationUnit</code> 39 * will fix a problem. 40 * 41 * @return The change or null if no fix possible 42 * @throws CoreException 43 */ 44 public abstract TextChange createChange() throws CoreException; 45 46 /** 47 * The <code>ICompilationUnit</code> on which <code>createChange</code> should 48 * be applied to fix a problem. 49 * 50 * @return The ICompilationUnit, not null 51 */ 52 public abstract ICompilationUnit getCompilationUnit(); 53 54 /** 55 * A status to inform about issues with this fix 56 * 57 * @return The status, not null 58 */ 59 public abstract IStatus getStatus(); 60 } 61