Interface ITextFileBufferManager
- All Superinterfaces:
IFileBufferManager
Clients are not supposed to implement that interface.
- Since:
- 3.0
- Restriction:
- This interface is not intended to be implemented by clients.
- Restriction:
- This interface is not intended to be extended by clients.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ITextFileBufferManager
The default text file buffer manager. -
Method Summary
Modifier and TypeMethodDescriptioncreateAnnotationModel
(IPath location) Deprecated.createAnnotationModel
(IPath location, LocationKind locationKind) Creates a new annotation for the given location.createEmptyDocument
(IPath location) Deprecated.As of 3.3, replaced bycreateEmptyDocument(IPath, LocationKind)
createEmptyDocument
(IPath location, LocationKind locationKind) Creates a new empty document.Returns the default encoding that is used to read the contents of text files if no other encoding is specified.getFileStoreTextFileBuffer
(IFileStore fileStore) Returns the text file buffer managed for the given file store ornull
if there is no such text file buffer.getTextFileBuffer
(IPath location) Deprecated.As of 3.3, replaced bygetTextFileBuffer(IPath, LocationKind)
getTextFileBuffer
(IPath location, LocationKind locationKind) Returns the text file buffer managed for the file at the given location ornull
if there is no such text file buffer.getTextFileBuffer
(IDocument document) Returns the text file buffer managed for the given document ornull
if there is no such text file buffer.boolean
isTextFileLocation
(IPath location) Deprecated.As of 3.2, replaced byisTextFileLocation(IPath, boolean)
boolean
isTextFileLocation
(IPath location, boolean strict) Returns whether a file at the given location is or can be considered a text file.Methods inherited from interface org.eclipse.core.filebuffers.IFileBufferManager
addFileBufferListener, connect, connect, connectFileStore, disconnect, disconnect, disconnectFileStore, execute, getFileBuffer, getFileBuffer, getFileBuffers, getFileStoreFileBuffer, getFileStoreFileBuffers, releaseSynchronizationContext, removeFileBufferListener, requestSynchronizationContext, setSynchronizationContext, validateState
-
Field Details
-
DEFAULT
The default text file buffer manager.- Since:
- 3.3
-
-
Method Details
-
getTextFileBuffer
Deprecated.As of 3.3, replaced bygetTextFileBuffer(IPath, LocationKind)
Returns the text file buffer managed for the file at the given location ornull
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.
- Parameters:
location
- the location- Returns:
- the text file buffer managed for that location or
null
-
getTextFileBuffer
Returns the text file buffer managed for the file at the given location ornull
if there is no such text file buffer.The type of the provided location is specified by the given
locationKind
.- Parameters:
location
- the locationlocationKind
- the kind of the given location- Returns:
- the text file buffer managed for that location or
null
- Since:
- 3.3
- See Also:
-
getFileStoreTextFileBuffer
Returns the text file buffer managed for the given file store ornull
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. The encoding of the file in the workspace will not be considered.
We had to use a different name than
getTextFileBuffer
for this method due to https://bugs.eclipse.org/bugs/show_bug.cgi?id=148844- Parameters:
fileStore
- the file store- Returns:
- the text file buffer managed for that file store or
null
- Since:
- 3.3
-
getTextFileBuffer
Returns the text file buffer managed for the given document ornull
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.
- Parameters:
document
- the document for which to find the text file buffer- Returns:
- the text file buffer managed for that document or
null
- Since:
- 3.3
-
getDefaultEncoding
String getDefaultEncoding()Returns the default encoding that is used to read the contents of text files if no other encoding is specified.- Returns:
- the default text file encoding
-
createEmptyDocument
Deprecated.As of 3.3, replaced bycreateEmptyDocument(IPath, LocationKind)
Creates a new empty document. The document is set up in the same way as it would be used in a text file buffer for a file at the given location.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.
- Parameters:
location
- the location used to set up the newly created document ornull
if unknown- Returns:
- a new empty document
-
createEmptyDocument
Creates a new empty document. The document is set up in the same way as it would be used in a text file buffer for a file at the given location.The type of the provided location is specified by the given
locationKind
.- Parameters:
location
- the location used to set up the newly created document ornull
if unknownlocationKind
- the kind of the given location- Returns:
- a new empty document
- Since:
- 3.3
-
createAnnotationModel
Deprecated.As of 3.3, replaced bycreateAnnotationModel(IPath, LocationKind)
Creates a new annotation for the given location.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.
- Parameters:
location
- the location used to create the new annotation model- Returns:
- the newly created annotation model
-
createAnnotationModel
Creates a new annotation for the given location.The type of the provided location is specified by the given
locationKind
.- Parameters:
location
- the location used to create the new annotation modellocationKind
- the kind of the given location- Returns:
- the newly created annotation model
- Since:
- 3.3
-
isTextFileLocation
Deprecated.As of 3.2, replaced byisTextFileLocation(IPath, boolean)
Returns whether a file at the given location is or can be considered a text file. If the file exists, the concrete content type of the file is checked. If the concrete content type for the existing file can not be determined, this method returnstrue
. 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 returnstrue
.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.
- Parameters:
location
- the location to check- Returns:
true
if the location is a text file location- Since:
- 3.1
-
isTextFileLocation
Returns whether a file at the given location is or can be considered a text file. If the file exists, the concrete content type of the file is checked. If the concrete content type for the existing file can not be determined, this method returns!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.
- Parameters:
location
- the location to checkstrict
-true
if a file with unknown content type is not treated as text file,false
otherwise- Returns:
true
if the location is a text file location- Since:
- 3.2
-
createAnnotationModel(IPath, LocationKind)