org.netbeans.modules.refactoring.java.spi
Class JavaRefactoringPlugin
java.lang.Object
org.netbeans.modules.refactoring.spi.ProgressProviderAdapter
org.netbeans.modules.refactoring.java.spi.JavaRefactoringPlugin
- All Implemented Interfaces:
- ProgressProvider, RefactoringPlugin
public abstract class JavaRefactoringPlugin
- extends ProgressProviderAdapter
- implements RefactoringPlugin
|
Method Summary |
void |
cancelRequest()
|
Problem |
checkParameters()
|
protected Problem |
checkParameters(CompilationController javac)
|
protected Problem |
createAndAddElements(Set<FileObject> files,
CancellableTask<WorkingCopy> task,
RefactoringElementsBag elements,
AbstractRefactoring refactoring)
|
protected Problem |
createAndAddElements(Set<FileObject> files,
CancellableTask<WorkingCopy> task,
RefactoringElementsBag elements,
AbstractRefactoring refactoring,
ClasspathInfo info)
|
protected static Problem |
createProblem(Problem result,
boolean isFatal,
String message)
|
protected Problem |
createProblemAndLog(Problem p,
Throwable t)
|
static Transaction |
createTransaction(Collection<ModificationResult> modifications)
Create Java specific implementation of Transaction. |
Problem |
fastCheckParameters()
|
protected Problem |
fastCheckParameters(CompilationController javac)
|
protected ClasspathInfo |
getClasspathInfo(AbstractRefactoring refactoring)
|
protected abstract JavaSource |
getJavaSource(JavaRefactoringPlugin.Phase p)
|
protected static Problem |
isElementAvail(TreePathHandle e,
CompilationInfo info)
Checks if the element is still available. |
Problem |
preCheck()
|
protected Problem |
preCheck(CompilationController javac)
|
protected Collection<ModificationResult> |
processFiles(Set<FileObject> files,
CancellableTask<WorkingCopy> task)
|
protected Collection<ModificationResult> |
processFiles(Set<FileObject> files,
CancellableTask<WorkingCopy> task,
ClasspathInfo info)
|
protected void |
queryFiles(Set<FileObject> files,
CancellableTask<? extends CompilationController> task)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
cancelRequest
@Deprecated
protected volatile boolean cancelRequest
- Deprecated.
- Use cancelRequested
cancelRequested
protected final AtomicBoolean cancelRequested
- true if cancel was requested
false otherwise
JavaRefactoringPlugin
public JavaRefactoringPlugin()
createTransaction
public static Transaction createTransaction(@NonNull
Collection<ModificationResult> modifications)
- Create Java specific implementation of
Transaction.
- Parameters:
modifications - collection of ModificationResult
- Returns:
- Java specific Transaction
- Since:
- 1.24.0
- See Also:
RefactoringElementsBag.registerTransaction(Transaction)
preCheck
protected Problem preCheck(CompilationController javac)
throws IOException
- Throws:
IOException
checkParameters
protected Problem checkParameters(CompilationController javac)
throws IOException
- Throws:
IOException
fastCheckParameters
protected Problem fastCheckParameters(CompilationController javac)
throws IOException
- Throws:
IOException
getJavaSource
protected abstract JavaSource getJavaSource(JavaRefactoringPlugin.Phase p)
preCheck
public Problem preCheck()
- Specified by:
preCheck in interface RefactoringPlugin
checkParameters
public Problem checkParameters()
- Specified by:
checkParameters in interface RefactoringPlugin
fastCheckParameters
public Problem fastCheckParameters()
- Specified by:
fastCheckParameters in interface RefactoringPlugin
cancelRequest
public void cancelRequest()
- Specified by:
cancelRequest in interface RefactoringPlugin
getClasspathInfo
protected ClasspathInfo getClasspathInfo(AbstractRefactoring refactoring)
createProblem
protected static Problem createProblem(Problem result,
boolean isFatal,
String message)
isElementAvail
protected static Problem isElementAvail(TreePathHandle e,
CompilationInfo info)
- Checks if the element is still available. Tests if it is still valid.
(Was not deleted by matching mechanism.)
If element is available, returns null, otherwise it creates problem.
(Helper method for refactoring implementation as this problem is
general for all refactorings.)
- Parameters:
e - element to checkinfo -
- Returns:
- problem message or null if the element is valid
processFiles
protected final Collection<ModificationResult> processFiles(Set<FileObject> files,
CancellableTask<WorkingCopy> task)
throws IOException
- Throws:
IOException
processFiles
protected final Collection<ModificationResult> processFiles(Set<FileObject> files,
CancellableTask<WorkingCopy> task,
ClasspathInfo info)
throws IOException
- Throws:
IOException
queryFiles
protected final void queryFiles(Set<FileObject> files,
CancellableTask<? extends CompilationController> task)
throws IOException
- Throws:
IOException
createAndAddElements
protected final Problem createAndAddElements(Set<FileObject> files,
CancellableTask<WorkingCopy> task,
RefactoringElementsBag elements,
AbstractRefactoring refactoring,
ClasspathInfo info)
createAndAddElements
protected final Problem createAndAddElements(Set<FileObject> files,
CancellableTask<WorkingCopy> task,
RefactoringElementsBag elements,
AbstractRefactoring refactoring)
createProblemAndLog
protected final Problem createProblemAndLog(Problem p,
Throwable t)