Package org.eclipse.handly.buffer
Interface ICoreTextFileBufferProvider
public interface ICoreTextFileBufferProvider
An object capable of providing
ITextFileBuffer
for an underlying file.
Essentially, combines an ITextFileBufferManager
and a file location.-
Method Summary
Modifier and TypeMethodDescriptionvoid
connect
(org.eclipse.core.runtime.IProgressMonitor monitor) Connects the underlying file buffer to this provider.void
disconnect
(org.eclipse.core.runtime.IProgressMonitor monitor) Disconnects the underlying file buffer from this provider.static ICoreTextFileBufferProvider
forFileStore
(org.eclipse.core.filesystem.IFileStore fileStore, org.eclipse.core.filebuffers.ITextFileBufferManager bufferManager) Returns anICoreTextFileBufferProvider
for the given file store and buffer manager.static ICoreTextFileBufferProvider
forLocation
(org.eclipse.core.runtime.IPath location, org.eclipse.core.filebuffers.LocationKind locationKind, org.eclipse.core.filebuffers.ITextFileBufferManager bufferManager) Returns anICoreTextFileBufferProvider
for the given file location and buffer manager.org.eclipse.core.filebuffers.ITextFileBuffer
Returns theITextFileBuffer
managed for the underlying file, ornull
if there is no such buffer.org.eclipse.core.filebuffers.ITextFileBufferManager
Returns the underlyingITextFileBufferManager
.
-
Method Details
-
connect
void connect(org.eclipse.core.runtime.IProgressMonitor monitor) throws org.eclipse.core.runtime.CoreException Connects the underlying file buffer to this provider. After this method has successfully completed it is guaranteed that each invocation ofgetBuffer()
returns the same buffer instance untildisconnect
is called.- Parameters:
monitor
- a progress monitor, ornull
if 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 file buffer could not be connectedorg.eclipse.core.runtime.OperationCanceledException
- if this method is canceled
-
disconnect
void disconnect(org.eclipse.core.runtime.IProgressMonitor monitor) throws org.eclipse.core.runtime.CoreException Disconnects the underlying file buffer from this provider. After this method has successfully completed there is no guarantee thatgetBuffer()
will return a valid buffer.- Parameters:
monitor
- a progress monitor, ornull
if 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 file buffer could not be disconnectedorg.eclipse.core.runtime.OperationCanceledException
- if this method is canceled
-
getBuffer
org.eclipse.core.filebuffers.ITextFileBuffer getBuffer()Returns theITextFileBuffer
managed for the underlying file, ornull
if there is no such buffer.- Returns:
- the buffer managed for the underlying file,
or
null
if none
-
getBufferManager
org.eclipse.core.filebuffers.ITextFileBufferManager getBufferManager()Returns the underlyingITextFileBufferManager
.- Returns:
- the underlying buffer manager (never
null
)
-
forLocation
static ICoreTextFileBufferProvider forLocation(org.eclipse.core.runtime.IPath location, org.eclipse.core.filebuffers.LocationKind locationKind, org.eclipse.core.filebuffers.ITextFileBufferManager bufferManager) Returns anICoreTextFileBufferProvider
for the given file location and buffer manager.- Parameters:
location
- notnull
locationKind
- notnull
bufferManager
- notnull
- Returns:
- a buffer provider for the given file location and buffer manager
(never
null
)
-
forFileStore
static ICoreTextFileBufferProvider forFileStore(org.eclipse.core.filesystem.IFileStore fileStore, org.eclipse.core.filebuffers.ITextFileBufferManager bufferManager) Returns anICoreTextFileBufferProvider
for the given file store and buffer manager.- Parameters:
fileStore
- notnull
bufferManager
- notnull
- Returns:
- a buffer provider for the given file store and buffer manager
(never
null
)
-