Class OrganizeImportsOperation
java.lang.Object
org.eclipse.jdt.core.manipulation.OrganizeImportsOperation
- All Implemented Interfaces:
IWorkspaceRunnable,ICoreRunnable
- Since:
- 1.10
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionOrganizeImportsOperation(ICompilationUnit cu, CompilationUnit astRoot, boolean ignoreLowerCaseNames, boolean save, boolean allowSyntaxErrors, OrganizeImportsOperation.IChooseImportQuery chooseImportQuery) Creates a new OrganizeImportsOperation operation. -
Method Summary
Modifier and TypeMethodDescriptionintintAfter executing the operation, returnsnullif the operation has been executed successfully or the range where parsing failed.voidrun(IProgressMonitor monitor) Runs the operation.
-
Constructor Details
-
OrganizeImportsOperation
public OrganizeImportsOperation(ICompilationUnit cu, CompilationUnit astRoot, boolean ignoreLowerCaseNames, boolean save, boolean allowSyntaxErrors, OrganizeImportsOperation.IChooseImportQuery chooseImportQuery) Creates a new OrganizeImportsOperation operation.- Parameters:
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 ornullto not select anything
-
-
Method Details
-
run
Runs the operation.- Specified by:
runin interfaceICoreRunnable- Specified by:
runin interfaceIWorkspaceRunnable- Parameters:
monitor- the progress monitor- Throws:
CoreException- thrown when the operation failedOperationCanceledException- Runtime error thrown when operation is canceled.
-
createTextEdit
-
getParseError
After executing the operation, returnsnullif the operation has been executed successfully or the range where parsing failed.- Returns:
- returns the parse error
-
getNumberOfImportsAdded
public int getNumberOfImportsAdded()- Returns:
- Returns the number of import statements added for this operation
-
getNumberOfImportsRemoved
public int getNumberOfImportsRemoved()- Returns:
- Returns the number of import statements removed for this operation
-
getScheduleRule
- Returns:
- Returns the scheduling rule for this operation
-