public interface ISourceFileImpl extends ISourceElementImpl, ISourceFile
ISourceFile
s must implement this interface.Modifier and Type | Method and Description |
---|---|
IBuffer |
getBuffer_(IContext context,
org.eclipse.core.runtime.IProgressMonitor monitor)
Returns a buffer opened for this source file.
|
default org.eclipse.core.resources.IFile |
getFile_()
Returns the underlying
IFile , or null
if this source file has no underlying file in the workspace. |
boolean |
isWorkingCopy_()
Returns whether this source file is a working copy.
|
boolean |
needsReconciling_()
Returns whether this source file needs reconciling.
|
void |
reconcile_(IContext context,
org.eclipse.core.runtime.IProgressMonitor monitor)
Reconciles this source file.
|
getSourceElementAt_, getSourceElementInfo_
equalsAndSameParentChain_, exists_, getChildren_, getChildrenOfType_, getHandleMemento_, getLocationUri_, getModel_, getName_, getParent_, getResource_, getRoot_, toDisplayString_, toString_
default org.eclipse.core.resources.IFile getFile_()
IFile
, or null
if this source file has no underlying file in the workspace.
This is a handle-only method.
This method returns the same value as IElementImpl.getResource_()
,
but saves a downcast.
IFile
, or null
if this source file has no underlying file in the workspaceboolean isWorkingCopy_()
true
if this source file is a working copy,
and false
otherwiseboolean needsReconciling_()
true
if this source file needs reconciling,
and false
otherwisevoid reconcile_(IContext context, org.eclipse.core.runtime.IProgressMonitor monitor) throws org.eclipse.core.runtime.CoreException
Implementations are encouraged to support the following standard options, which may be specified in the given context:
FORCE_RECONCILING
- Indicates whether reconciling has to be performed
even if the working copy buffer has not been modified since the last time
the working copy was reconciled.
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 receiverorg.eclipse.core.runtime.CoreException
- if the working copy could not be reconciledorg.eclipse.core.runtime.OperationCanceledException
- if this method is canceledIBuffer getBuffer_(IContext context, org.eclipse.core.runtime.IProgressMonitor monitor) throws org.eclipse.core.runtime.CoreException
The client takes (potentially shared) ownership of the returned buffer and is responsible for releasing it when finished. The buffer will be disposed only after it is released by every owner. The buffer must not be accessed by clients which do not own it.
A new object may be returned, even for the same underlying buffer, each time this method is invoked. For working copies, the relationship between the source file and the underlying working copy buffer does not change over the lifetime of a working copy.
Implementations are encouraged to support the following standard options, which may be specified in the given context:
CREATE_BUFFER
-
Indicates whether a new buffer should be created if none already exists
for this source file.
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 receivernull
if CREATE_BUFFER
is false
in the given context
and there is no buffer currently opened for the source fileorg.eclipse.core.runtime.CoreException
- if this source file does not exist or if an
exception occurs while accessing its corresponding resourceorg.eclipse.core.runtime.OperationCanceledException
- if this method is canceledCopyright (c) 2014, 2019 1C-Soft LLC and others. Made available under the Eclipse Public License 2.0