public interface IFileBufferManager
connect
. After that call has
successfully completed the file buffer can be obtained by getFileBuffer
.
The file buffer is created on the first connect and disposed on the last
disconnect. I.e. the file buffer manager keeps track of how often a file is
connected and returns the same file buffer to each client as long as the
file is connected.
Clients are not supposed to implement that interface.
Modifier and Type | Method and Description |
---|---|
void |
addFileBufferListener(IFileBufferListener listener)
Adds the given listener to the list of file buffer listeners.
|
void |
connect(IPath location,
IProgressMonitor monitor)
Deprecated.
As of 3.3, replaced by
connect(IPath, LocationKind, IProgressMonitor) |
void |
connect(IPath location,
LocationKind locationKind,
IProgressMonitor monitor)
Connects the file at the given location to this manager.
|
void |
connectFileStore(IFileStore fileStore,
IProgressMonitor monitor)
Connects the given file store to this manager.
|
void |
disconnect(IPath location,
IProgressMonitor monitor)
Deprecated.
As of 3.3, replaced by
disconnect(IPath, LocationKind, IProgressMonitor) |
void |
disconnect(IPath location,
LocationKind locationKind,
IProgressMonitor monitor)
Disconnects the file at the given location from this manager.
|
void |
disconnectFileStore(IFileStore fileStore,
IProgressMonitor monitor)
Disconnects the given file store from this manager.
|
void |
execute(Runnable runnable)
Executes the given runnable in the synchronization context of this file buffer manager.
|
IFileBuffer |
getFileBuffer(IPath location)
Deprecated.
As of 3.3, replaced by
getFileBuffer(IPath, LocationKind) |
IFileBuffer |
getFileBuffer(IPath location,
LocationKind locationKind)
Returns the file buffer managed for the given location or
null
if there is no such file buffer. |
IFileBuffer[] |
getFileBuffers()
Returns all managed file buffers that are currently connected.
|
IFileBuffer |
getFileStoreFileBuffer(IFileStore fileStore)
Returns the file buffer managed for the given file store or
null if there is no such file buffer. |
IFileBuffer[] |
getFileStoreFileBuffers()
Returns all managed file store file buffers that are currently connected.
|
void |
releaseSynchronizationContext(IPath location)
Deprecated.
As of 3.1, replaced by
IFileBuffer.releaseSynchronizationContext() |
void |
removeFileBufferListener(IFileBufferListener listener)
Removes the given listener from the list of file buffer listeners.
|
void |
requestSynchronizationContext(IPath location)
Deprecated.
As of 3.1, replaced by
IFileBuffer.requestSynchronizationContext() |
void |
setSynchronizationContext(ISynchronizationContext context)
Sets the synchronization context for this file buffer manager, i.e., for
all file buffers this manager manages.
|
void |
validateState(IFileBuffer[] fileBuffers,
IProgressMonitor monitor,
Object computationContext)
Validates the state of the given file buffers and tries to bring the buffer's underlying file
into a state in which it can be modified.
|
void connect(IPath location, IProgressMonitor monitor) throws CoreException
connect(IPath, LocationKind, IProgressMonitor)
getFileBuffer
returns the same file buffer until disconnect
is called.
The provided location is either a full path of a workspace resource or an absolute path in the local file system. The file buffer manager does not resolve the location of workspace resources in the case of linked resources.
location
- the location of the file to be connectedmonitor
- the progress monitor, or null
if progress reporting is not desiredCoreException
- if the file could not successfully be connectedvoid connect(IPath location, LocationKind locationKind, IProgressMonitor monitor) throws CoreException
getFileBuffer
returns the same file buffer until disconnect
is called.
The type of the provided location is specified by the given
locationKind
.
location
- the location of the file to be connectedlocationKind
- the kind of the given locationmonitor
- the progress monitor, or null
if progress reporting is not desiredCoreException
- if the file could not successfully be connectedLocationKind
void connectFileStore(IFileStore fileStore, IProgressMonitor monitor) throws CoreException
getFileBuffer
returns the same file buffer until disconnect
is called.
Note: This API must not be used if the given file store maps to a resource contained in the workspace. A file buffer that has been connected using a path will not be found.
We had to use a different name than connect
for this method
due to https://bugs.eclipse.org/bugs/show_bug.cgi?id=148844
fileStore
- the file store to be connectedmonitor
- the progress monitor, or null
if progress reporting is not desiredCoreException
- if the file could not successfully be connectedvoid disconnect(IPath location, IProgressMonitor monitor) throws CoreException
disconnect(IPath, LocationKind, IProgressMonitor)
getFileBuffer
will return a valid file buffer.
The provided location is either a full path of a workspace resource or an absolute path in the local file system. The file buffer manager does not resolve the location of workspace resources in the case of linked resources.
location
- the location of the file to be disconnectedmonitor
- the progress monitor, or null
if progress reporting is not desiredCoreException
- if the file could not successfully be disconnectedvoid disconnect(IPath location, LocationKind locationKind, IProgressMonitor monitor) throws CoreException
getFileBuffer
will return a valid file buffer.
The type of the provided location is specified by the given
locationKind
.
location
- the location of the file to be disconnectedlocationKind
- the kind of the given locationmonitor
- the progress monitor, or null
if progress reporting is not desiredCoreException
- if the file could not successfully be disconnectedLocationKind
void disconnectFileStore(IFileStore fileStore, IProgressMonitor monitor) throws CoreException
getFileBuffer
will return a valid file buffer.
Note: This API must not be used if the given file store maps to a resource contained in the workspace. A file buffer that has been connected using a path will not be found.
We had to use a different name than disconnect
for this method
due to https://bugs.eclipse.org/bugs/show_bug.cgi?id=148844
fileStore
- the file store to be disconnectedmonitor
- the progress monitor, or null
if progress reporting is not desiredCoreException
- if the file could not successfully be disconnectedIFileBuffer getFileBuffer(IPath location)
getFileBuffer(IPath, LocationKind)
null
if there is no such file buffer.
The provided location is either a full path of a workspace resource or an absolute path in the local file system. The file buffer manager does not resolve the location of workspace resources in the case of linked resources.
location
- the locationnull
IFileBuffer getFileBuffer(IPath location, LocationKind locationKind)
null
if there is no such file buffer.
The type of the provided location is specified by the given
locationKind
.
location
- the locationlocationKind
- the kind of the given locationnull
LocationKind
IFileBuffer getFileStoreFileBuffer(IFileStore fileStore)
null
if there is no such file buffer.
Note: This API must not be used if the given file store maps to a resource contained in the workspace. A file buffer that has been connected using a path will not be found.
We had to use a different name than getFileBuffer
for this method
due to https://bugs.eclipse.org/bugs/show_bug.cgi?id=148844
fileStore
- the file storenull
IFileBuffer[] getFileBuffers()
Note: It is the clients responsibility to handle disconnected file buffers as buffers can be disconnected after calling this method.
getFileStoreFileBuffers()
IFileBuffer[] getFileStoreFileBuffers()
Note: It is the clients responsibility to handle disconnected file buffers as buffers can be disconnected after calling this method.
getFileBuffers()
void setSynchronizationContext(ISynchronizationContext context)
context
- the synchronization context managed by this file buffer managervoid execute(Runnable runnable)
runnable
- the runnable to be executedvoid requestSynchronizationContext(IPath location)
IFileBuffer.requestSynchronizationContext()
The provided location is either a full path of a workspace resource or an absolute path in the local file system. The file buffer manager does not resolve the location of workspace resources in the case of linked resources.
location
- the locationvoid releaseSynchronizationContext(IPath location)
IFileBuffer.releaseSynchronizationContext()
The provided location is either a full path of a workspace resource or an absolute path in the local file system. The file buffer manager does not resolve the location of workspace resources in the case of linked resources.
location
- the locationvoid addFileBufferListener(IFileBufferListener listener)
listener
- the listener to be addedvoid removeFileBufferListener(IFileBufferListener listener)
listener
- the listener to be removedvoid validateState(IFileBuffer[] fileBuffers, IProgressMonitor monitor, Object computationContext) throws CoreException
In case of a single file buffer, IFileBuffer.validateState(IProgressMonitor, Object)
should be used.
fileBuffers
- the file buffers to validatemonitor
- the progress monitor, or null
if progress reporting is not
desiredcomputationContext
- the context in which the validation is performed, e.g., a SWT shellCoreException
- if the underlying file can not be accessed or its state cannot be
changed
Copyright (c) 2000, 2014 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.