Package org.eclipse.handly.model
Interface ISourceFileExtension
-
- All Superinterfaces:
IElement,ISourceElement,ISourceFile
public interface ISourceFileExtension extends ISourceFile
Model implementors may opt to extend this interface, which extendsISourceFilewith a number of default methods.This interface is not intended to be referenced for purposes other than extension.
-
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default IBuffergetBuffer()Returns a buffer opened for this source file.default org.eclipse.core.resources.IFilegetFile()Returns the underlyingIFile, ornullif this source file has no underlying file in the workspace.default booleanisWorkingCopy()Returns whether this source file is a working copy.default booleanneedsReconciling()Returns whether this source file needs reconciling.default voidreconcile(org.eclipse.core.runtime.IProgressMonitor monitor)Reconciles this source file.
-
-
-
Method Detail
-
getFile
default org.eclipse.core.resources.IFile getFile()
Returns the underlyingIFile, ornullif this source file has no underlying file in the workspace. This is a handle-only method.- Returns:
- the underlying
IFile, ornullif this source file has no underlying file in the workspace
-
isWorkingCopy
default boolean isWorkingCopy()
Returns whether this source file is a working copy.- Returns:
trueif this source file is a working copy, andfalseotherwise
-
needsReconciling
default boolean needsReconciling()
Returns whether this source file needs reconciling. A source file needs reconciling if it is a working copy and its buffer has been modified since the last time it was reconciled.- Returns:
trueif this source file needs reconciling, andfalseotherwise
-
reconcile
default void reconcile(org.eclipse.core.runtime.IProgressMonitor monitor) throws org.eclipse.core.runtime.CoreExceptionReconciles this source file. Does nothing if the source file is not in working copy mode or if its buffer has not been modified since the last time it was reconciled.- Parameters:
monitor- a progress monitor, ornullif progress reporting is not desired. The caller must not rely onIProgressMonitor.done()having been called by the receiver- Throws:
org.eclipse.core.runtime.CoreException- if the working copy could not be reconciledorg.eclipse.core.runtime.OperationCanceledException- if this method is canceled
-
getBuffer
default IBuffer getBuffer() throws org.eclipse.core.runtime.CoreException
Returns a buffer opened for this source file. Note that buffers may be shared by multiple clients, so the returned buffer may have unsaved changes if it has been modified by another client.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.
- Returns:
- a buffer opened for this source file (never
null) - Throws:
org.eclipse.core.runtime.CoreException- if this source file does not exist or if an exception occurs while accessing its corresponding resource
-
-