# Uses of Interface
org.eclipse.jdt.core.ICompilationUnit

Packages that use ICompilationUnit
Package
Description
org.eclipse.jdt.apt.core.env
This package contains Eclipse extensions to some of the Sun annotation processing APIs.
org.eclipse.jdt.core
The Java model is the set of classes that model the objects associated with creating, editing, and building a Java program.
org.eclipse.jdt.core.compiler
This package contains compiler associated infrastructure APIs.
org.eclipse.jdt.core.dom
The Java DOM/AST is the set of classes that model the source code of a Java program as a structured document.
org.eclipse.jdt.core.dom.rewrite
The Java DOM/AST rewrite is the set of classes that are used to make changes to an existing DOM/AST tree.
org.eclipse.jdt.core.manipulation
Application programming interface for the JDT core manipulation plug-in class.
org.eclipse.jdt.core.refactoring
Application programming interface for Java-specified refactoring framework facilities.
org.eclipse.jdt.core.refactoring.descriptors
Application programming interface to access Java refactorings provided by JDT.
org.eclipse.jdt.core.search
Provides support for searching the workspace Java elements that match a particular description.
org.eclipse.jdt.core.util
Provides a set of tools and utilities for manipulating .class files and Java model elements.
org.eclipse.jdt.junit.wizards
Application programming interfaces to implement wizards to create new JUnit testcases.
org.eclipse.jdt.ui
Application programming interfaces for interaction with the Eclipse Java User Interface.
org.eclipse.jdt.ui.actions
Application programming interfaces for Eclipse Java User Interface specific actions.
org.eclipse.jdt.ui.cleanup
Application programming interfaces for code clean up.
org.eclipse.jdt.ui.refactoring
Application programming interfaces for rename refactorings.
org.eclipse.jdt.ui.text.java
Application programming interfaces for interaction with the Eclipse Java User Interface.
org.eclipse.jdt.ui.text.java.correction
Application programming interfaces for correction proposals.
org.eclipse.jdt.ui.wizards
Application programming interfaces for interaction with the Eclipse Java User Interface wizards.

## Uses of ICompilationUnit in org.eclipse.jdt.apt.core.env

Methods in org.eclipse.jdt.apt.core.env with parameters of type ICompilationUnit
Modifier and Type
Method
Description
`static AnnotationProcessorEnvironment`
EnvironmentFactory.`getEnvironment(ICompilationUnit compilationUnit, IJavaProject javaProject)`
Return a processor environment for use outside of building or reconciling.

## Uses of ICompilationUnit in org.eclipse.jdt.core

Fields in org.eclipse.jdt.core declared as ICompilationUnit
Modifier and Type
Field
Description
`protected ICompilationUnit`
CorrectionEngine.`compilationUnit`
This field is not intended to be used by client.
Methods in org.eclipse.jdt.core that return ICompilationUnit
Modifier and Type
Method
Description
`ICompilationUnit`
IClassFile.`becomeWorkingCopy(IProblemRequestor problemRequestor, WorkingCopyOwner owner, org.eclipse.core.runtime.IProgressMonitor monitor)`
Deprecated.
Use `ITypeRoot.getWorkingCopy(WorkingCopyOwner, IProgressMonitor)` instead.
`ICompilationUnit`
IPackageFragment.`createCompilationUnit(String name, String contents, boolean force, org.eclipse.core.runtime.IProgressMonitor monitor)`
Creates and returns a compilation unit in this package fragment with the specified name and contents.
`static ICompilationUnit`
JavaCore.`createCompilationUnitFrom(org.eclipse.core.resources.IFile file)`
Creates and returns a compilation unit element for the given source file (i.e. a file with one of the `Java-like extensions`).
`ICompilationUnit`
ICompilationUnit.`findWorkingCopy(WorkingCopyOwner owner)`
Finds the working copy for this compilation unit, given a `WorkingCopyOwner`.
`ICompilationUnit`
IMember.`getCompilationUnit()`
Returns the compilation unit in which this member is declared, or `null` if this member is not declared in a compilation unit (for example, a binary type).
`ICompilationUnit`
IPackageFragment.`getCompilationUnit(String name)`
Returns the compilation unit with the specified name in this package (for example, `"Object.java"`).
`ICompilationUnit[]`
IPackageFragment.`getCompilationUnits()`
Returns all of the compilation units in this package fragment.
`ICompilationUnit[]`
IPackageFragment.`getCompilationUnits(WorkingCopyOwner owner)`
Returns all of the compilation units in this package fragment that are in working copy mode and that have the given owner.
`ICompilationUnit`
ICompilationUnit.`getPrimary()`
Returns the primary compilation unit (whose owner is the primary owner) this working copy was created from, or this compilation unit if this a primary compilation unit.
`static ICompilationUnit[]`
JavaCore.`getWorkingCopies(WorkingCopyOwner owner)`
Returns the working copies that have the given owner.
`ICompilationUnit`
ICompilationUnit.`getWorkingCopy(org.eclipse.core.runtime.IProgressMonitor monitor)`
Returns a new working copy of this compilation unit if it is a primary compilation unit, or this compilation unit if it is already a non-primary working copy.
`ICompilationUnit`
ICompilationUnit.`getWorkingCopy(WorkingCopyOwner owner, IProblemRequestor problemRequestor, org.eclipse.core.runtime.IProgressMonitor monitor)`
Deprecated.
Use `ITypeRoot.getWorkingCopy(WorkingCopyOwner, IProgressMonitor)` instead.
`ICompilationUnit`
ITypeRoot.`getWorkingCopy(WorkingCopyOwner owner, org.eclipse.core.runtime.IProgressMonitor monitor)`
Returns a shared working copy on this compilation unit or class file using the given working copy owner to create the buffer.
`final ICompilationUnit`
WorkingCopyOwner.`newWorkingCopy(String name, IClasspathEntry[] classpath, org.eclipse.core.runtime.IProgressMonitor monitor)`
Returns a new working copy with the given name using this working copy owner to create its buffer.
`final ICompilationUnit`
WorkingCopyOwner.`newWorkingCopy(String name, IClasspathEntry[] classpath, IProblemRequestor problemRequestor, org.eclipse.core.runtime.IProgressMonitor monitor)`
Deprecated.
Use `WorkingCopyOwner.newWorkingCopy(String, IClasspathEntry[], IProgressMonitor)` instead.
Methods in org.eclipse.jdt.core with parameters of type ICompilationUnit
Modifier and Type
Method
Description
`void`
CorrectionEngine.`computeCorrections(org.eclipse.core.resources.IMarker marker, ICompilationUnit targetUnit, int positionOffset, ICorrectionRequestor requestor)`
Performs code correction for the given marker, reporting results to the given correction requestor.
`void`
CorrectionEngine.`computeCorrections(IProblem problem, ICompilationUnit targetUnit, ICorrectionRequestor requestor)`
Performs code correction for the given IProblem, reporting results to the given correction requestor.
`IBuffer`
WorkingCopyOwner.`createBuffer(ICompilationUnit workingCopy)`
Creates a buffer for the given working copy.
`IProblemRequestor`
WorkingCopyOwner.`getProblemRequestor(ICompilationUnit workingCopy)`
Returns the problem requestor used by a working copy of this working copy owner.
`ITypeHierarchy`
IType.`newSupertypeHierarchy(ICompilationUnit[] workingCopies, org.eclipse.core.runtime.IProgressMonitor monitor)`
Creates and returns a type hierarchy for this type containing this type and all of its supertypes, considering types in the given working copies.
`ITypeHierarchy`
IType.`newTypeHierarchy(ICompilationUnit[] workingCopies, org.eclipse.core.runtime.IProgressMonitor monitor)`
Creates and returns a type hierarchy for this type containing this type, all of its supertypes, and all its subtypes in the workspace, considering types in the given working copies.

## Uses of ICompilationUnit in org.eclipse.jdt.core.compiler

Methods in org.eclipse.jdt.core.compiler that return ICompilationUnit
Modifier and Type
Method
Description
`ICompilationUnit`
ReconcileContext.`getWorkingCopy()`
Returns the working copy this context refers to.

## Uses of ICompilationUnit in org.eclipse.jdt.core.dom

Methods in org.eclipse.jdt.core.dom with parameters of type ICompilationUnit
Modifier and Type
Method
Description
`void`
ASTRequestor.`acceptAST(ICompilationUnit source, CompilationUnit ast)`
Accepts an AST corresponding to the compilation unit.
`void`
ASTParser.`createASTs(ICompilationUnit[] compilationUnits, String[] bindingKeys, ASTRequestor requestor, org.eclipse.core.runtime.IProgressMonitor monitor)`
Creates ASTs for a batch of compilation units.
`static CompilationUnit`
AST.`parseCompilationUnit(ICompilationUnit unit, boolean resolveBindings)`
Deprecated.
Use `ASTParser` instead.
`void`
ASTParser.`setSource(ICompilationUnit source)`
Sets the source code to be parsed.

## Uses of ICompilationUnit in org.eclipse.jdt.core.dom.rewrite

Methods in org.eclipse.jdt.core.dom.rewrite that return ICompilationUnit
Modifier and Type
Method
Description
`ICompilationUnit`
ImportRewrite.`getCompilationUnit()`
The compilation unit for which this import rewrite was created for.
Methods in org.eclipse.jdt.core.dom.rewrite with parameters of type ICompilationUnit
Modifier and Type
Method
Description
`static ImportRewrite`
ImportRewrite.`create(ICompilationUnit cu, boolean restoreExistingImports)`
Creates an `ImportRewrite` from an `ICompilationUnit`.

## Uses of ICompilationUnit in org.eclipse.jdt.core.manipulation

Methods in org.eclipse.jdt.core.manipulation that return ICompilationUnit
Modifier and Type
Method
Description
`ICompilationUnit`
CleanUpContextCore.`getCompilationUnit()`
Deprecated.
`ICompilationUnit`
CUCorrectionProposalCore.`getCompilationUnit()`
The compilation unit on which the change works.
Methods in org.eclipse.jdt.core.manipulation with parameters of type ICompilationUnit
Modifier and Type
Method
Description
`static ImportRewrite`
CodeStyleConfiguration.`createImportRewrite(ICompilationUnit cu, boolean restoreExistingImports)`
Returns a `ImportRewrite` using `ImportRewrite.create(ICompilationUnit, boolean)` and configures the rewriter with the settings as specified in the JDT UI preferences.
`static String`
CodeGeneration.`getCompilationUnitContent(ICompilationUnit cu, String typeComment, String typeContent, String lineDelimiter)`
Returns the content for a new compilation unit using the 'new Java file' code template.
`static String`
CodeGeneration.`getCompilationUnitContent(ICompilationUnit cu, String fileComment, String typeComment, String typeContent, String lineDelimiter)`
Returns the content for a new compilation unit using the 'new Java file' code template.
`static String`
CodeGeneration.`getFieldComment(ICompilationUnit cu, String typeName, String fieldName, String lineDelimiter)`
Returns the content for a new field comment using the 'field comment' code template.
`static String`
CodeGeneration.`getFileComment(ICompilationUnit cu, String lineDelimiter)`
Returns the content for a new file comment using the 'file comment' code template.
`static String`
CodeGeneration.`getGetterComment(ICompilationUnit cu, String declaringTypeName, String methodName, String fieldName, String fieldType, String bareFieldName, String lineDelimiter)`
Returns the comment for a getter method using the getter comment template.
`static String`
CodeGeneration.`getGetterMethodBodyContent(ICompilationUnit cu, String declaringTypeName, String methodName, String fieldName, String lineDelimiter)`
Returns the content of body for a getter method using the getter method body template.
`static String`
CodeGeneration.`getMethodBodyContent(ICompilationUnit cu, String declaringTypeName, String methodName, boolean isConstructor, boolean useAlternativeMethodBody, String bodyStatement, String lineDelimiter)`
Returns the content of the body for a method or constructor using the method body templates.
`static String`
CodeGeneration.`getMethodBodyContent(ICompilationUnit cu, String declaringTypeName, String methodName, boolean isConstructor, String bodyStatement, String lineDelimiter)`
Returns the content of the body for a method or constructor using the method body templates.
`static String`
CodeGeneration.`getMethodComment(ICompilationUnit cu, String declaringTypeName, String methodName, String[] paramNames, String[] excTypeSig, String retTypeSig, String[] typeParameterNames, IMethod overridden, String lineDelimiter)`
Returns the comment for a method or constructor using the comment code templates (constructor / method / overriding method).
`static String`
CodeGeneration.`getMethodComment(ICompilationUnit cu, String declaringTypeName, String methodName, String[] paramNames, String[] excTypeSig, String retTypeSig, IMethod overridden, String lineDelimiter)`
Returns the comment for a method or constructor using the comment code templates (constructor / method / overriding method).
`static String`
CodeGeneration.`getMethodComment(ICompilationUnit cu, String declaringTypeName, MethodDeclaration decl, boolean isDeprecated, String overriddenMethodName, String overriddenMethodDeclaringTypeName, String[] overriddenMethodParameterTypeNames, String lineDelimiter)`
Returns the comment for a method or constructor using the comment code templates (constructor / method / overriding method).
`static String`
CodeGeneration.`getMethodComment(ICompilationUnit cu, String declaringTypeName, MethodDeclaration decl, IMethodBinding overridden, String lineDelimiter)`
Returns the comment for a method or constructor using the comment code templates (constructor / method / overriding method).
`static String`
CodeGeneration.`getModuleComment(ICompilationUnit cu, String moduleName, String[] providesNames, String[] usesNames, String lineDelimiter)`
Returns the comment for a module based on code templates
`static String`
CodeGeneration.`getModuleComment(ICompilationUnit cu, IModuleDescription desc, String lineDelimiter)`
Returns the comment for a module based on code templates
`static String`
CodeGeneration.`getSetterComment(ICompilationUnit cu, String declaringTypeName, String methodName, String fieldName, String fieldType, String paramName, String bareFieldName, String lineDelimiter)`
Returns the comment for a setter method using the setter method body template.
`static String`
CodeGeneration.`getSetterMethodBodyContent(ICompilationUnit cu, String declaringTypeName, String methodName, String fieldName, String paramName, String lineDelimiter)`
Returns the content of body for a setter method using the setter method body template.
`static String`
CodeGeneration.`getTypeBody(String typeKind, ICompilationUnit cu, String typeName, String lineDelim)`
Returns the content of a new new type body using the 'type body' code templates.
`static String`
CodeGeneration.`getTypeComment(ICompilationUnit cu, String typeQualifiedName, String lineDelimiter)`
Returns the content for a new type comment using the 'type comment' code template.
`static String`
CodeGeneration.`getTypeComment(ICompilationUnit cu, String typeQualifiedName, String[] typeParameterNames, String lineDelimiter)`
Returns the content for a new type comment using the 'type comment' code template.
`static String`
CodeGeneration.`getTypeComment(ICompilationUnit cu, String typeQualifiedName, String[] typeParameterNames, String[] params, String lineDelimiter)`
Returns the content for a new type comment using the 'type comment' code template.
Constructors in org.eclipse.jdt.core.manipulation with parameters of type ICompilationUnit
Modifier
Constructor
Description
``
`CleanUpContextCore(ICompilationUnit unit, CompilationUnit ast)`
Deprecated.
`protected`
`CUCorrectionProposalCore(String name, ICompilationUnit cu, int relevance)`
Constructs a correction proposal working on a compilation unit.
``
`CUCorrectionProposalCore(String name, ICompilationUnit cu, org.eclipse.ltk.core.refactoring.TextChange change, int relevance)`
Constructs a correction proposal working on a compilation unit with a given text change.
``
`CUCorrectionProposalCore(ICUCorrectionProposal proposal, String name, ICompilationUnit cu, org.eclipse.ltk.core.refactoring.TextChange change, int relevance)`
Constructs a correction proposal working on a compilation unit with a given text change.
``
`OrganizeImportsOperation(ICompilationUnit cu, CompilationUnit astRoot, boolean ignoreLowerCaseNames, boolean save, boolean allowSyntaxErrors, OrganizeImportsOperation.IChooseImportQuery chooseImportQuery)`
Creates a new OrganizeImportsOperation operation.
``
`OrganizeImportsOperation(ICompilationUnit cu, CompilationUnit astRoot, boolean ignoreLowerCaseNames, boolean save, boolean allowSyntaxErrors, OrganizeImportsOperation.IChooseImportQuery chooseImportQuery, boolean restoreExistingImports)`
Creates a new OrganizeImportsOperation operation.

## Uses of ICompilationUnit in org.eclipse.jdt.core.refactoring

Methods in org.eclipse.jdt.core.refactoring that return ICompilationUnit
Modifier and Type
Method
Description
`ICompilationUnit`
CompilationUnitChange.`getCompilationUnit()`
Returns the compilation unit this change works on.
Constructors in org.eclipse.jdt.core.refactoring with parameters of type ICompilationUnit
Modifier
Constructor
Description
``
`CompilationUnitChange(String name, ICompilationUnit cunit)`
Creates a new `CompilationUnitChange`.

## Uses of ICompilationUnit in org.eclipse.jdt.core.refactoring.descriptors

Methods in org.eclipse.jdt.core.refactoring.descriptors with parameters of type ICompilationUnit
Modifier and Type
Method
Description
`void`
RenameLocalVariableDescriptor.`setCompilationUnit(ICompilationUnit unit)`
Deprecated.
`void`
MoveDescriptor.`setMoveResources(org.eclipse.core.resources.IFile[] files, org.eclipse.core.resources.IFolder[] folders, ICompilationUnit[] units)`
Sets the resources and compilation units to move.

## Uses of ICompilationUnit in org.eclipse.jdt.core.search

Constructors in org.eclipse.jdt.core.search with parameters of type ICompilationUnit
Modifier
Constructor
Description
``
`SearchEngine(ICompilationUnit[] workingCopies)`
Creates a new search engine with a list of working copies that will take precedence over their original compilation units in the subsequent search operations.

## Uses of ICompilationUnit in org.eclipse.jdt.core.util

Methods in org.eclipse.jdt.core.util with parameters of type ICompilationUnit
Modifier and Type
Method
Description
`static void`
CompilationUnitSorter.`sort(int level, ICompilationUnit compilationUnit, int[] positions, Comparator comparator, int options, org.eclipse.core.runtime.IProgressMonitor monitor)`
Reorders the declarations in the given compilation unit according to the specified AST level.
`static void`
CompilationUnitSorter.`sort(ICompilationUnit compilationUnit, int[] positions, Comparator comparator, int options, org.eclipse.core.runtime.IProgressMonitor monitor)`
Deprecated.
Clients should port their code to use the new JLS3 AST API and call `CompilationUnitSorter.sort(AST.JLS3, compilationUnit, positions, comparator, options, monitor)` instead of using this method.

## Uses of ICompilationUnit in org.eclipse.jdt.junit.wizards

Methods in org.eclipse.jdt.junit.wizards with parameters of type ICompilationUnit
Modifier and Type
Method
Description
`protected String`
NewTestSuiteWizardPage.`constructCUContent(ICompilationUnit cu, String typeContent, String lineDelimiter)`

## Uses of ICompilationUnit in org.eclipse.jdt.ui

Methods in org.eclipse.jdt.ui that return ICompilationUnit
Modifier and Type
Method
Description
`ICompilationUnit`
IWorkingCopyManager.`getWorkingCopy(org.eclipse.ui.IEditorInput input)`
Returns the working copy remembered for the compilation unit encoded in the given editor input.
Methods in org.eclipse.jdt.ui with parameters of type ICompilationUnit
Modifier and Type
Method
Description
`static ImportRewrite`
CodeStyleConfiguration.`createImportRewrite(ICompilationUnit cu, boolean restoreExistingImports)`
Returns a `ImportRewrite` using `ImportRewrite.create(ICompilationUnit, boolean)` and configures the rewriter with the settings as specified in the JDT UI preferences.
`static String`
CodeGeneration.`getCompilationUnitContent(ICompilationUnit cu, String typeComment, String typeContent, String lineDelimiter)`
Deprecated.
`static String`
CodeGeneration.`getCompilationUnitContent(ICompilationUnit cu, String fileComment, String typeComment, String typeContent, String lineDelimiter)`
Deprecated.
`static void`
JavaElementLabels.`getCompilationUnitLabel(ICompilationUnit cu, long flags, StringBuffer buf)`
Appends the label for a compilation unit to a `StringBuffer`.
`static void`
JavaElementLabels.`getCompilationUnitLabel(ICompilationUnit cu, long flags, org.eclipse.jface.viewers.StyledString result)`
Appends the label for a compilation unit to a `StyledString`.
`static String`
CodeGeneration.`getFieldComment(ICompilationUnit cu, String typeName, String fieldName, String lineDelimiter)`
Deprecated.
`static String`
CodeGeneration.`getFileComment(ICompilationUnit cu, String lineDelimiter)`
Deprecated.
`static String`
CodeGeneration.`getGetterComment(ICompilationUnit cu, String declaringTypeName, String methodName, String fieldName, String fieldType, String bareFieldName, String lineDelimiter)`
Deprecated.
`static String`
CodeGeneration.`getGetterMethodBodyContent(ICompilationUnit cu, String declaringTypeName, String methodName, String fieldName, String lineDelimiter)`
Deprecated.
`static String`
CodeGeneration.`getMethodBodyContent(ICompilationUnit cu, String declaringTypeName, String methodName, boolean isConstructor, String bodyStatement, String lineDelimiter)`
Deprecated.
`static String`
CodeGeneration.`getMethodComment(ICompilationUnit cu, String declaringTypeName, String methodName, String[] paramNames, String[] excTypeSig, String retTypeSig, String[] typeParameterNames, IMethod overridden, String lineDelimiter)`
Deprecated.
`static String`
CodeGeneration.`getMethodComment(ICompilationUnit cu, String declaringTypeName, String methodName, String[] paramNames, String[] excTypeSig, String retTypeSig, IMethod overridden, String lineDelimiter)`
Deprecated.
`static String`
CodeGeneration.`getMethodComment(ICompilationUnit cu, String declaringTypeName, MethodDeclaration decl, boolean isDeprecated, String overriddenMethodName, String overriddenMethodDeclaringTypeName, String[] overriddenMethodParameterTypeNames, String lineDelimiter)`
Deprecated.
`static String`
CodeGeneration.`getMethodComment(ICompilationUnit cu, String declaringTypeName, MethodDeclaration decl, IMethodBinding overridden, String lineDelimiter)`
Deprecated.
`static String`
CodeGeneration.`getSetterComment(ICompilationUnit cu, String declaringTypeName, String methodName, String fieldName, String fieldType, String paramName, String bareFieldName, String lineDelimiter)`
Deprecated.
`static String`
CodeGeneration.`getSetterMethodBodyContent(ICompilationUnit cu, String declaringTypeName, String methodName, String fieldName, String paramName, String lineDelimiter)`
Deprecated.
`static String`
CodeGeneration.`getTypeBody(String typeKind, ICompilationUnit cu, String typeName, String lineDelim)`
Deprecated.
`static String`
CodeGeneration.`getTypeComment(ICompilationUnit cu, String typeQualifiedName, String lineDelimiter)`
Deprecated.
`static String`
CodeGeneration.`getTypeComment(ICompilationUnit cu, String typeQualifiedName, String[] typeParameterNames, String lineDelimiter)`
Deprecated.
`void`
IWorkingCopyManagerExtension.`setWorkingCopy(org.eclipse.ui.IEditorInput input, ICompilationUnit workingCopy)`
Sets the given working copy for the given editor input.

## Uses of ICompilationUnit in org.eclipse.jdt.ui.actions

Methods in org.eclipse.jdt.ui.actions with parameters of type ICompilationUnit
Modifier and Type
Method
Description
`void`
ExternalizeStringsAction.`run(ICompilationUnit unit)`
Note: this method is for internal use only.
`void`
OrganizeImportsAction.`run(ICompilationUnit cu)`
Runs the organize import action on a single compilation unit
`void`
FormatAllAction.`runOnMultiple(ICompilationUnit[] cus)`
Perform format all on the given compilation units.
`void`
OrganizeImportsAction.`runOnMultiple(ICompilationUnit[] cus)`
Perform organize import on multiple compilation units.

## Uses of ICompilationUnit in org.eclipse.jdt.ui.cleanup

Methods in org.eclipse.jdt.ui.cleanup that return ICompilationUnit
Modifier and Type
Method
Description
`ICompilationUnit`
CleanUpContext.`getCompilationUnit()`
Methods in org.eclipse.jdt.ui.cleanup with parameters of type ICompilationUnit
Modifier and Type
Method
Description
`org.eclipse.ltk.core.refactoring.RefactoringStatus`
ICleanUp.`checkPreConditions(IJavaProject project, ICompilationUnit[] compilationUnits, org.eclipse.core.runtime.IProgressMonitor monitor)`
After call to checkPreConditions clients will start creating fixes for `compilationUnits` in `project` unless the result of checkPreConditions contains a fatal error
Constructors in org.eclipse.jdt.ui.cleanup with parameters of type ICompilationUnit
Modifier
Constructor
Description
``
`CleanUpContext(ICompilationUnit unit, CompilationUnit ast)`
Creates a new clean up context.

## Uses of ICompilationUnit in org.eclipse.jdt.ui.refactoring

Methods in org.eclipse.jdt.ui.refactoring with parameters of type ICompilationUnit
Modifier and Type
Method
Description
`static RenameSupport`
RenameSupport.`create(ICompilationUnit unit, String newName, int flags)`
Creates a new rename support for the given `ICompilationUnit`.

## Uses of ICompilationUnit in org.eclipse.jdt.ui.text.java

Methods in org.eclipse.jdt.ui.text.java that return ICompilationUnit
Modifier and Type
Method
Description
`protected final ICompilationUnit`
CompletionProposalCollector.`getCompilationUnit()`
Returns the compilation unit that the receiver operates on, or `null` if the `IJavaProject` constructor was used to create the receiver.
`ICompilationUnit`
JavaContentAssistInvocationContext.`getCompilationUnit()`
Returns the compilation unit that content assist is invoked in, `null` if there is none.
Methods in org.eclipse.jdt.ui.text.java with parameters of type ICompilationUnit
Modifier and Type
Method
Description
`IJavaCompletionProposal[]`
IJavadocCompletionProcessor.`computeCompletionProposals(ICompilationUnit cu, int offset, int length, int flags)`
Deprecated.
`org.eclipse.jface.text.contentassist.IContextInformation[]`
IJavadocCompletionProcessor.`computeContextInformation(ICompilationUnit cu, int offset)`
Deprecated.
`boolean`
IQuickFixProcessor.`hasCorrections(ICompilationUnit unit, int problemId)`
Returns `true` if the processor has proposals for the given problem.
Constructors in org.eclipse.jdt.ui.text.java with parameters of type ICompilationUnit
Modifier
Constructor
Description
``
`CompletionProposalCollector(ICompilationUnit cu)`
Creates a new instance ready to collect proposals.
``
`CompletionProposalCollector(ICompilationUnit cu, boolean ignoreAll)`
Creates a new instance ready to collect proposals.
``
`JavaContentAssistInvocationContext(ICompilationUnit unit)`
Creates a new context.

## Uses of ICompilationUnit in org.eclipse.jdt.ui.text.java.correction

Methods in org.eclipse.jdt.ui.text.java.correction that return ICompilationUnit
Modifier and Type
Method
Description
`final ICompilationUnit`
CUCorrectionProposal.`getCompilationUnit()`
The compilation unit on which the change works.
`protected ICompilationUnit`
CUCorrectionProposal.`getInitialCompilationUnit()`
Constructors in org.eclipse.jdt.ui.text.java.correction with parameters of type ICompilationUnit
Modifier
Constructor
Description
``
`ASTRewriteCorrectionProposal(String name, ICompilationUnit cu, ASTRewrite rewrite, int relevance)`
Constructs an AST rewrite correction proposal.
``
`ASTRewriteCorrectionProposal(String name, ICompilationUnit cu, ASTRewrite rewrite, int relevance, org.eclipse.swt.graphics.Image image)`
Constructs an AST rewrite correction proposal.
``
`ASTRewriteCorrectionProposal(String name, ICompilationUnit cu, ASTRewrite rewrite, int relevance, org.eclipse.swt.graphics.Image image, org.eclipse.jdt.ui.text.java.correction.ASTRewriteCorrectionProposalCore delegate)`
Constructs an AST rewrite correction proposal.
`protected`
`CUCorrectionProposal(String name, ICompilationUnit cu, int relevance, org.eclipse.swt.graphics.Image image)`
Constructs a correction proposal working on a compilation unit.
``
`CUCorrectionProposal(String name, ICompilationUnit cu, int relevance, org.eclipse.swt.graphics.Image image, CUCorrectionProposalCore delegate)`
Constructs a correction proposal working on a compilation unit.
``
`CUCorrectionProposal(String name, ICompilationUnit cu, org.eclipse.ltk.core.refactoring.TextChange change, int relevance)`
Constructs a correction proposal working on a compilation unit with a given text change.
``
`CUCorrectionProposal(String name, ICompilationUnit cu, org.eclipse.ltk.core.refactoring.TextChange change, int relevance, org.eclipse.swt.graphics.Image image)`
Constructs a correction proposal working on a compilation unit with a given text change.
``
`CUCorrectionProposal(String name, ICompilationUnit cu, org.eclipse.ltk.core.refactoring.TextChange change, int relevance, org.eclipse.swt.graphics.Image image, CUCorrectionProposalCore delegate)`
Constructs a correction proposal working on a compilation unit.

## Uses of ICompilationUnit in org.eclipse.jdt.ui.wizards

Methods in org.eclipse.jdt.ui.wizards with parameters of type ICompilationUnit
Modifier and Type
Method
Description
`protected String`
NewTypeWizardPage.`constructCUContent(ICompilationUnit cu, String typeContent, String lineDelimiter)`
Uses the New Java file template from the code template page to generate a compilation unit with the given type content.
`protected String`
NewTypeWizardPage.`getFileComment(ICompilationUnit parentCU)`
Deprecated.
Instead of file templates, the new type code template specifies the stub for a compilation unit.
`protected String`
NewTypeWizardPage.`getFileComment(ICompilationUnit parentCU, String lineDelimiter)`
Hook method that gets called from `createType` to retrieve a file comment.
`protected String`
NewTypeWizardPage.`getTemplate(String name, ICompilationUnit parentCU)`
Deprecated.
Use getTemplate(String,ICompilationUnit,int)
`protected String`
NewTypeWizardPage.`getTemplate(String name, ICompilationUnit parentCU, int pos)`
Returns the string resulting from evaluation the given template in the context of the given compilation unit.
`protected String`
NewTypeWizardPage.`getTypeComment(ICompilationUnit parentCU)`
Deprecated.
Use getTypeComment(ICompilationUnit, String)
`protected String`
NewTypeWizardPage.`getTypeComment(ICompilationUnit parentCU, String lineDelimiter)`
Hook method that gets called from `createType` to retrieve a type comment.