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 TypeMethodDescriptionvoidconnect(org.eclipse.core.runtime.IProgressMonitor monitor) Connects the underlying file buffer to this provider.voiddisconnect(org.eclipse.core.runtime.IProgressMonitor monitor) Disconnects the underlying file buffer from this provider.static ICoreTextFileBufferProviderforFileStore(org.eclipse.core.filesystem.IFileStore fileStore, org.eclipse.core.filebuffers.ITextFileBufferManager bufferManager) Returns anICoreTextFileBufferProviderfor the given file store and buffer manager.static ICoreTextFileBufferProviderforLocation(org.eclipse.core.runtime.IPath location, org.eclipse.core.filebuffers.LocationKind locationKind, org.eclipse.core.filebuffers.ITextFileBufferManager bufferManager) Returns anICoreTextFileBufferProviderfor the given file location and buffer manager.org.eclipse.core.filebuffers.ITextFileBufferReturns theITextFileBuffermanaged for the underlying file, ornullif there is no such buffer.org.eclipse.core.filebuffers.ITextFileBufferManagerReturns 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 untildisconnectis called.- 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 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, 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 file buffer could not be disconnectedorg.eclipse.core.runtime.OperationCanceledException- if this method is canceled
-
getBuffer
org.eclipse.core.filebuffers.ITextFileBuffer getBuffer()Returns theITextFileBuffermanaged for the underlying file, ornullif there is no such buffer.- Returns:
- the buffer managed for the underlying file,
or
nullif 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 anICoreTextFileBufferProviderfor the given file location and buffer manager.- Parameters:
location- notnulllocationKind- notnullbufferManager- 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 anICoreTextFileBufferProviderfor the given file store and buffer manager.- Parameters:
fileStore- notnullbufferManager- notnull- Returns:
- a buffer provider for the given file store and buffer manager
(never
null)
-