Changes this class file handle into a working copy. A new
IBuffer is
created using the given owner. Uses the primary owner if null is
specified.
When switching to working copy mode, problems are reported to the given
IProblemRequestor . Note that once in working copy mode, the given
IProblemRequestor is ignored. Only the original
IProblemRequestor is used to report subsequent problems.
Once in working copy mode, changes to this working copy or its children are done in memory.
Only the new buffer is affected.
Using
ICompilationUnit.commitWorkingCopy(booleanIProgressMonitor) on the working copy
will throw a JavaModelException as a class file is implicetly read-only.
If this class file was already in working copy mode, an internal counter is incremented and no
other action is taken on this working copy. To bring this working copy back into the original mode
(where it reflects the underlying resource),
ICompilationUnit.discardWorkingCopy must be call as many
times as
IClassFile.becomeWorkingCopy(IProblemRequestor,WorkingCopyOwner,IProgressMonitor) .
The primary compilation unit of a class file's working copy does not exist if the class file is not
in working copy mode (classFileWorkingCopy.getPrimary().exists() == false ).
The resource of a class file's working copy is null if the class file is in an external jar file.
Parameters: problemRequestor - a requestor which will get notified of problems detected duringreconciling as they are discovered. The requestor can be set to null indicatingthat the client is not interested in problems. Parameters: owner - the given WorkingCopyOwner, or null for the primary owner Parameters: monitor - a progress monitor used to report progress while opening this compilation unitor null if no progress should be reported a working copy for this class file throws: JavaModelException - if this compilation unit could not become a working copy. See Also: ICompilationUnit.discardWorkingCopy since: 3.2ITypeRoot.getWorkingCopy(WorkingCopyOwnerIProgressMonitor) |