public interface ISourceFileImplExtension extends ISourceFileImpl
ISourceFileImpl
that introduces the notion of
working copy. ISourceFile
s may implement this interface.Modifier and Type | Field and Description |
---|---|
static Property<IBuffer> |
WORKING_COPY_BUFFER
Specifies the working copy buffer.
|
static Property<IWorkingCopyCallback> |
WORKING_COPY_CALLBACK
Specifies the working copy callback.
|
static Property<IContext> |
WORKING_COPY_CONTEXT
Specifies the working copy context.
|
Modifier and Type | Method and Description |
---|---|
boolean |
acquireExistingWorkingCopy_(org.eclipse.core.runtime.IProgressMonitor monitor)
If this source file is already in working copy mode, acquires a new
independent ownership of the working copy by incrementing an internal
counter.
|
boolean |
becomeWorkingCopy_(IContext context,
org.eclipse.core.runtime.IProgressMonitor monitor)
If this source file is not already in working copy mode, switches it
into a working copy, associates it with a working copy buffer, and
acquires an independent ownership of the working copy (and, hence,
of the working copy buffer).
|
IContext |
getWorkingCopyContext_()
Returns the context associated with the working copy, or
null
if this source file is not a working copy. |
boolean |
releaseWorkingCopy_()
Relinquishes an independent ownership of the working copy by decrementing
an internal counter.
|
getBuffer_, getFile_, getFileStore_, isWorkingCopy_, needsReconciling_, reconcile_
getSourceElementAt_, getSourceElementInfo_
equalsAndSameParentChain_, exists_, getChildren_, getChildrenOfType_, getHandleMemento_, getLocationUri_, getModel_, getName_, getParent_, getResource_, getRoot_, toDisplayString_, toString_
static final Property<IBuffer> WORKING_COPY_BUFFER
static final Property<IWorkingCopyCallback> WORKING_COPY_CALLBACK
boolean becomeWorkingCopy_(IContext context, org.eclipse.core.runtime.IProgressMonitor monitor) throws org.eclipse.core.runtime.CoreException
In working copy mode, the source file's structure and properties
shall no longer correspond to the underlying resource contents and
must no longer be updated by a resource delta processor. Instead,
the source file's structure and properties can be explicitly reconciled
with the current
contents of the working copy buffer.
This method supports the following options, which may be specified in the given context:
WORKING_COPY_BUFFER
- Specifies the working copy buffer.
If not set, a default buffer for this source file will be used for
the working copy.
WORKING_COPY_CALLBACK
- Specifies the working copy callback.
If set, the given callback must be a new instance: callbacks may not be
shared or reused between working copies.
WORKING_COPY_CONTEXT
- Specifies the working copy context.
If set, the given context will be associated with the working copy and
can be accessed via getWorkingCopyContext_()
method.
If the source file was already in working copy mode, this method acquires a new independent ownership of the working copy by incrementing an internal counter; the given context is ignored.
Each call to this method that did not throw an exception must ultimately
be followed by exactly one call to releaseWorkingCopy_()
.
context
- the operation context (not null
)monitor
- a progress monitor, or null
if progress reporting is not desired. The caller must not rely on
IProgressMonitor.done()
having been called by the receivertrue
if this source file became a working copy,
and false
if it was already in working copy modeorg.eclipse.core.runtime.CoreException
- if the working copy could not be createdorg.eclipse.core.runtime.OperationCanceledException
- if this method is canceledacquireExistingWorkingCopy_(IProgressMonitor)
boolean acquireExistingWorkingCopy_(org.eclipse.core.runtime.IProgressMonitor monitor)
false
if this source file is not a working
copy. Performs atomically.
Each successful call to this method that did not return false
must ultimately be followed by exactly one call to releaseWorkingCopy_()
.
monitor
- a progress monitor, or null
if progress reporting is not desired. The caller must not rely on
IProgressMonitor.done()
having been called by the receivertrue
if an existing working copy was acquired,
and false
if this source file is not a working copyorg.eclipse.core.runtime.OperationCanceledException
- if this method is canceledbecomeWorkingCopy_(IContext, IProgressMonitor)
boolean releaseWorkingCopy_()
Each independent ownership of the working copy must ultimately end with exactly one call to this method. Clients which do not own the working copy must not call this method.
true
if this source file was switched from
working copy mode back to its original mode, and false
otherwiseIContext getWorkingCopyContext_()
null
if this source file is not a working copy. The context, as a set of
bindings, and its association with the working copy do not change
over the lifetime of the working copy.
The returned context is composed of the context explicitly specified
when creating the working copy and
an intrinsic context of the working copy itself, in that order.
null
if this source file is not a working copyCopyright (c) 2014, 2020 1C-Soft LLC and others. Made available under the Eclipse Public License 2.0