|
Eclipse JDT Release 3.2 |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.jdt.core.WorkingCopyOwner
The owner of an ICompilationUnit
handle in working copy mode.
An owner is used to identify a working copy and to create its buffer.
Clients should subclass this class to instantiate a working copy owner that is specific to their need and that
they can pass in to various APIs (e.g. IType.resolveType(String, WorkingCopyOwner)
.
Clients can also override the default implementation of createBuffer(ICompilationUnit)
.
Note: even though this class has no abstract method, which means that it provides functional default behavior, it is still an abstract class, as clients are intended to own their owner implementation.
ICompilationUnit.becomeWorkingCopy(IProblemRequestor, org.eclipse.core.runtime.IProgressMonitor)
,
ICompilationUnit.discardWorkingCopy()
,
ICompilationUnit.getWorkingCopy(org.eclipse.core.runtime.IProgressMonitor)
Constructor Summary | |
---|---|
WorkingCopyOwner()
|
Method Summary | |
---|---|
IBuffer |
createBuffer(ICompilationUnit workingCopy)
Creates a buffer for the given working copy. |
ICompilationUnit |
newWorkingCopy(String name,
IClasspathEntry[] classpath,
IProblemRequestor problemRequestor,
IProgressMonitor monitor)
Returns a new working copy with the given name using this working copy owner to create its buffer. |
static void |
setPrimaryBufferProvider(WorkingCopyOwner primaryBufferProvider)
Sets the buffer provider of the primary working copy owner. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public WorkingCopyOwner()
Method Detail |
public static void setPrimaryBufferProvider(WorkingCopyOwner primaryBufferProvider)
createBuffer(ICompilationUnit)
method is used by the primary working copy owner. It doesn't replace the internal primary
working owner.
This method is for internal use by the jdt-related plug-ins. Clients outside of the jdt should not reference this method.
primaryBufferProvider
- the primary buffer providerpublic IBuffer createBuffer(ICompilationUnit workingCopy)
null
).
Note: This buffer will be associated to the working copy for its entire life-cycle. Another working copy on same unit but owned by a different owner would not share the same buffer unless its owner decided to implement such a sharing behaviour.
workingCopy
- the working copy of the buffer
IBuffer
public final ICompilationUnit newWorkingCopy(String name, IClasspathEntry[] classpath, IProblemRequestor problemRequestor, IProgressMonitor monitor) throws JavaModelException
null
and it cannot be resolved in any way.
Problems are never reported and a DOM AST created using this working copy
will not have bindings resolved.
When the working copy instance is created, an added delta
is
reported on this working copy.
Once done with the working copy, users of this method must discard it using
ICompilationUnit.discardWorkingCopy()
.
Note that when such working copy is committed, only its buffer is saved (see
IBuffer.save(IProgressMonitor, boolean)
) but no resource is created.
This method is not intended to be overriden by clients.
monitor
- a progress monitor used to report progress while opening this
working copy or null
if no progress should be reported
JavaModelException
- if the contents of this working copy can
not be determined.
|
Eclipse JDT Release 3.2 |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |