public interface ITextFileBufferManager extends IFileBufferManager
Clients are not supposed to implement that interface.
Modifier and Type | Field and Description |
---|---|
static ITextFileBufferManager |
DEFAULT
The default text file buffer manager.
|
Modifier and Type | Method and Description |
---|---|
IAnnotationModel |
createAnnotationModel(IPath location)
Deprecated.
As of 3.3, replaced by
createAnnotationModel(IPath, LocationKind) |
IAnnotationModel |
createAnnotationModel(IPath location,
LocationKind locationKind)
Creates a new annotation for the given location.
|
IDocument |
createEmptyDocument(IPath location)
Deprecated.
As of 3.3, replaced by
createEmptyDocument(IPath, LocationKind) |
IDocument |
createEmptyDocument(IPath location,
LocationKind locationKind)
Creates a new empty document.
|
String |
getDefaultEncoding()
Returns the default encoding that is used to read the contents of text files
if no other encoding is specified.
|
ITextFileBuffer |
getFileStoreTextFileBuffer(IFileStore fileStore)
Returns the text file buffer managed for the given file store
or
null if there is no such text file buffer. |
ITextFileBuffer |
getTextFileBuffer(IDocument document)
Returns the text file buffer managed for the given document
or
null if there is no such text file buffer. |
ITextFileBuffer |
getTextFileBuffer(IPath location)
Deprecated.
As of 3.3, replaced by
getTextFileBuffer(IPath, LocationKind) |
ITextFileBuffer |
getTextFileBuffer(IPath location,
LocationKind locationKind)
Returns the text file buffer managed for the file at the given location
or
null if there is no such text file buffer. |
boolean |
isTextFileLocation(IPath location)
Deprecated.
As of 3.2, replaced by
isTextFileLocation(IPath, boolean) |
boolean |
isTextFileLocation(IPath location,
boolean strict)
Returns whether a file at the given location is or can be considered a
text file.
|
addFileBufferListener, connect, connect, connectFileStore, disconnect, disconnect, disconnectFileStore, execute, getFileBuffer, getFileBuffer, getFileBuffers, getFileStoreFileBuffer, getFileStoreFileBuffers, releaseSynchronizationContext, removeFileBufferListener, requestSynchronizationContext, setSynchronizationContext, validateState
static final ITextFileBufferManager DEFAULT
ITextFileBuffer getTextFileBuffer(IPath location)
getTextFileBuffer(IPath, LocationKind)
null
if either there is no such text 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
ITextFileBuffer getTextFileBuffer(IPath location, LocationKind locationKind)
null
if there is no such text file buffer.
The type of the provided location is specified by the given
locationKind
.
location
- the locationlocationKind
- the kind of the given locationnull
LocationKind
ITextFileBuffer getFileStoreTextFileBuffer(IFileStore fileStore)
null
if there is no such text 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 getTextFileBuffer
for this method
due to https://bugs.eclipse.org/bugs/show_bug.cgi?id=148844
fileStore
- the file storenull
ITextFileBuffer getTextFileBuffer(IDocument document)
null
if there is no such text file buffer.
Note: This method goes through the list of registered buffers and tests whether its document matches the given one. Therefore this method should not be used in performance critical code.
document
- the document for which to find the text file buffernull
String getDefaultEncoding()
IDocument createEmptyDocument(IPath location)
createEmptyDocument(IPath, LocationKind)
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 used to set up the newly created document or null
if unknownIDocument createEmptyDocument(IPath location, LocationKind locationKind)
The type of the provided location is specified by the given locationKind
.
location
- the location used to set up the newly created document or null
if unknownlocationKind
- the kind of the given locationIAnnotationModel createAnnotationModel(IPath location)
createAnnotationModel(IPath, LocationKind)
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 used to create the new annotation modelIAnnotationModel createAnnotationModel(IPath location, LocationKind locationKind)
The type of the provided location is specified by the given
locationKind
.
location
- the location used to create the new annotation modellocationKind
- the kind of the given locationboolean isTextFileLocation(IPath location)
isTextFileLocation(IPath, boolean)
true
. If the file does
not exist, it is checked whether a text content type is associated with
the given location. If no content type is associated with the location,
this method returns true
.
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 to checktrue
if the location is a text file locationboolean isTextFileLocation(IPath location, boolean strict)
!strict
. If the file does
not exist, it is checked whether a text content type is associated with
the given location. If no content type is associated with the location,
this method returns !strict
.
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 to checkstrict
- true
if a file with unknown content type
is not treated as text file, false
otherwisetrue
if the location is a text file location
Copyright (c) 2000, 2014 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.