public class OrganizeImportsOperation extends Object implements IWorkspaceRunnable
Modifier and Type | Class and Description |
---|---|
static interface |
OrganizeImportsOperation.IChooseImportQuery |
Constructor and Description |
---|
OrganizeImportsOperation(ICompilationUnit cu,
CompilationUnit astRoot,
boolean ignoreLowerCaseNames,
boolean save,
boolean allowSyntaxErrors,
OrganizeImportsOperation.IChooseImportQuery chooseImportQuery)
Creates a new OrganizeImportsOperation operation.
|
Modifier and Type | Method and Description |
---|---|
TextEdit |
createTextEdit(IProgressMonitor monitor) |
int |
getNumberOfImportsAdded() |
int |
getNumberOfImportsRemoved() |
IProblem |
getParseError()
After executing the operation, returns
null if the operation has been executed successfully or
the range where parsing failed. |
ISchedulingRule |
getScheduleRule() |
void |
run(IProgressMonitor monitor)
Runs the operation.
|
public OrganizeImportsOperation(ICompilationUnit cu, CompilationUnit astRoot, boolean ignoreLowerCaseNames, boolean save, boolean allowSyntaxErrors, OrganizeImportsOperation.IChooseImportQuery chooseImportQuery)
cu
- The compilation unitastRoot
- the compilation unit AST nodeignoreLowerCaseNames
- when true, type names starting with a lower case are ignoredsave
- If set, the result will be savedallowSyntaxErrors
- If set, the operation will only proceed when the compilation unit has no syntax errorschooseImportQuery
- Query element to be used for UI interaction or null
to not select anythingpublic void run(IProgressMonitor monitor) throws CoreException, OperationCanceledException
run
in interface IWorkspaceRunnable
run
in interface ICoreRunnable
monitor
- the progress monitorCoreException
- thrown when the operation failedOperationCanceledException
- Runtime error thrown when operation is canceled.public TextEdit createTextEdit(IProgressMonitor monitor) throws CoreException, OperationCanceledException
public IProblem getParseError()
null
if the operation has been executed successfully or
the range where parsing failed.public int getNumberOfImportsAdded()
public int getNumberOfImportsRemoved()
public ISchedulingRule getScheduleRule()
Copyright (c) 2000, 2018 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.