public class MockFileTypeManager extends FileTypeManager
FileTypeRegistry.FileTypeDetector
TOPIC
ourInstanceGetter
Constructor and Description |
---|
MockFileTypeManager() |
Modifier and Type | Method and Description |
---|---|
void |
addFileTypeListener(FileTypeListener listener)
Adds a listener for receiving notifications about changes in the list of
registered file types.
|
void |
associate(FileType type,
FileNameMatcher matcher) |
FileType |
findFileTypeByName(java.lang.String fileTypeName)
Finds a file type with the specified name.
|
java.lang.String [] |
getAssociatedExtensions(FileType type)
Returns the list of extensions associated with the specified file type.
|
java.util.List<FileNameMatcher> |
getAssociations(FileType type) |
FileType |
getFileTypeByExtension(java.lang.String extension)
Returns the file type for the specified extension.
|
FileType |
getFileTypeByFile(VirtualFile file)
Returns the file type for the specified file.
|
FileType |
getFileTypeByFileName(java.lang.String fileName)
Same as FileTypeRegistry.getFileTypeByFileName(CharSequence) but receives String parameter.
|
java.lang.String |
getIgnoredFilesList()
Returns the semicolon-delimited list of patterns for files and folders
which are excluded from the project structure though they may be present
physically on disk.
|
FileType |
getKnownFileTypeOrAssociate(VirtualFile file,
Project project) |
FileType [] |
getRegisteredFileTypes()
Returns the list of all registered file types.
|
FileType |
getStdFileType(java.lang.String fileTypeName) |
boolean |
isFileIgnored(java.lang.String name)
Checks if the specified file is ignored by the IDE.
|
boolean |
isFileIgnored(VirtualFile file) |
void |
registerFileType(FileType type,
java.util.List<? extends FileNameMatcher> defaultAssociations) |
void |
removeAssociation(FileType type,
FileNameMatcher matcher) |
void |
removeFileTypeListener(FileTypeListener listener)
Removes a listener for receiving notifications about changes in the list of
registered file types.
|
void |
setIgnoredFilesList(java.lang.String list)
Sets new list of semicolon-delimited patterns for files and folders which
are excluded from the project structure.
|
associateExtension, associatePattern, getInstance, getKnownFileTypeOrAssociate, parseFromString, registerFileType, removeAssociatedExtension
findFileTypeByLanguage, getFileTypeByFile, getFileTypeByFileName, isFileOfType
public void registerFileType(FileType type, java.util.List<? extends FileNameMatcher> defaultAssociations)
registerFileType
in class FileTypeManager
public FileType getFileTypeByFileName(java.lang.String fileName)
FileTypeRegistry
getFileTypeByFileName
in class FileTypeRegistry
public FileType getFileTypeByFile(VirtualFile file)
FileTypeRegistry
getFileTypeByFile
in class FileTypeRegistry
file
- The file for which the type is requested.public FileType getFileTypeByExtension(java.lang.String extension)
FileTypeRegistry
FileTypeRegistry.getFileTypeByFile(VirtualFile)
getFileTypeByExtension
in class FileTypeRegistry
extension
- The extension for which the file type is requested, not including the leading '.'.UnknownFileType.INSTANCE
if corresponding file type not foundpublic FileType [] getRegisteredFileTypes()
FileTypeRegistry
getRegisteredFileTypes
in class FileTypeRegistry
public boolean isFileIgnored(java.lang.String name)
FileTypeManager
isFileIgnored
in class FileTypeManager
name
- The name of the file to check.true
if the file is ignored, false
otherwise.public boolean isFileIgnored(VirtualFile file)
isFileIgnored
in class FileTypeRegistry
public java.lang.String [] getAssociatedExtensions(FileType type)
FileTypeManager
getAssociatedExtensions
in class FileTypeManager
type
- The file type for which the extensions are requested.public java.util.List<FileNameMatcher> getAssociations(FileType type)
getAssociations
in class FileTypeManager
public void addFileTypeListener(FileTypeListener listener)
FileTypeManager
addFileTypeListener
in class FileTypeManager
listener
- The listener instance.public void removeFileTypeListener(FileTypeListener listener)
FileTypeManager
removeFileTypeListener
in class FileTypeManager
listener
- The listener instance.public FileType getKnownFileTypeOrAssociate(VirtualFile file, Project project)
getKnownFileTypeOrAssociate
in class FileTypeManager
public java.lang.String getIgnoredFilesList()
FileTypeManager
getIgnoredFilesList
in class FileTypeManager
public void setIgnoredFilesList(java.lang.String list)
FileTypeManager
setIgnoredFilesList
in class FileTypeManager
list
- List of semicolon-delimited patterns.public void associate(FileType type, FileNameMatcher matcher)
associate
in class FileTypeManager
public void removeAssociation(FileType type, FileNameMatcher matcher)
removeAssociation
in class FileTypeManager
public FileType getStdFileType(java.lang.String fileTypeName)
getStdFileType
in class FileTypeManager
public FileType findFileTypeByName(java.lang.String fileTypeName)
FileTypeRegistry
findFileTypeByName
in class FileTypeRegistry