Interface IWorkingCopy

All Known Subinterfaces:
ICompilationUnit
All Known Implementing Classes:
AssistCompilationUnit, ClassFileWorkingCopy, CompilationUnit

public interface IWorkingCopy
Deprecated.
Use ICompilationUnit instead
Common protocol for Java elements that support working copies.

A working copy of a Java element acts just like a regular element (handle), except it is not attached to an underlying resource. A working copy is not visible to the rest of the Java model. Changes in a working copy's buffer are not realized in a resource. To bring the Java model up-to-date with a working copy's contents, an explicit commit must be performed on the working copy. Other operations performed on a working copy update the contents of the working copy's buffer but do not commit the contents of the working copy.

Note: The contents of a working copy is determined when a working copy is created, based on the current content of the element the working copy is created from. If a working copy is an IOpenable and is explicitly closed, the working copy's buffer will be thrown away. However, clients should not explicitly open and close working copies.

The client that creates a working copy is responsible for destroying the working copy. The Java model will never automatically destroy or close a working copy. (Note that destroying a working copy does not commit it to the model, it only frees up the memory occupied by the element). After a working copy is destroyed, the working copy cannot be accessed again. Non-handle methods will throw a JavaModelException indicating the Java element does not exist.

A working copy cannot be created from another working copy. Calling getWorkingCopy on a working copy returns the receiver.