|
Eclipse Platform Release 3.1 |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A file buffer manager manages file buffers for files while the files are
connected to the file buffer manager. In order to connect a file to a file
buffer manager call 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.
Method Summary | |
---|---|
void |
addFileBufferListener(IFileBufferListener listener)
Adds the given listener to the list of file buffer listeners. |
void |
connect(IPath location,
IProgressMonitor monitor)
Connects the file at the given location to this manager. |
void |
disconnect(IPath location,
IProgressMonitor monitor)
Disconnects the file at the given location from this manager. |
IFileBuffer |
getFileBuffer(IPath location)
Returns the file buffer managed for the given location or null
if there is no such file buffer.
|
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. |
Method Detail |
public void connect(IPath location, IProgressMonitor monitor) throws CoreException
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
CoreException
- if the file could not successfully be connectedpublic void disconnect(IPath location, IProgressMonitor monitor) throws CoreException
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
CoreException
- if the file could not successfully be disconnectedpublic IFileBuffer getFileBuffer(IPath location)
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 location
null
public void setSynchronizationContext(ISynchronizationContext context)
context
- the synchronization context managed by this file buffer managerpublic void 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 locationpublic void 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 locationpublic void addFileBufferListener(IFileBufferListener listener)
listener
- the listener to be addedpublic void removeFileBufferListener(IFileBufferListener listener)
listener
- the listener to be removedpublic void 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 monitorcomputationContext
- the context in which the validation is performed, e.g., a SWT shell
CoreException
- if the underlying file can not be accessed to it's state cannot be changed
|
Eclipse Platform Release 3.1 |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Guidelines for using Eclipse APIs.
Copyright (c) IBM Corp. and others 2000, 2005. All rights reserved.