public class ProjectLanguageConfiguration extends Object
EXPERIMENTAL. This class or interface has been added as part of a work in progress. There is no guarantee that this API will work or that it will remain the same. Please do not use this API without consulting with the CDT team.
Constructor and Description |
---|
ProjectLanguageConfiguration()
Creates a new
ProjectLanguageConfiguration with no
language mappings defined. |
Modifier and Type | Method and Description |
---|---|
void |
addContentTypeMapping(ICConfigurationDescription configuration,
String contentType,
String language)
Sets the language for a content type.
|
void |
addFileMapping(ICConfigurationDescription configuration,
org.eclipse.core.resources.IFile file,
String language)
Sets the language for a file.
|
void |
addFileMapping(ICConfigurationDescription configuration,
String filePath,
String language)
Sets the language for a file.
|
Map<String,Map<String,String>> |
getContentTypeMappings()
Returns a copy of all the per-configuration content type mappings stored in this configuration.
|
Map<String,Map<String,String>> |
getFileMappings()
Returns a copy of all the per-file content type mappings stored in this configuration.
|
String |
getLanguageForContentType(ICConfigurationDescription configuration,
String contentTypeId)
Returns the language id that is mapped to the given content type when
the given configuration is active.
|
String |
getLanguageForFile(ICConfigurationDescription configuration,
org.eclipse.core.resources.IFile file)
Returns the language id that is mapped to the given file when the given
configuration is active.
|
String |
getLanguageForFile(ICConfigurationDescription configuration,
String path)
Returns the language id that is mapped to the file located at the given path
when the given configuration is active.
|
void |
removeAllFileMappings(org.eclipse.core.resources.IFile file)
Removes all language mappings for the given file.
|
void |
removeAllFileMappings(String filePath)
Removes all language mappings for the given file.
|
void |
removeContentTypeMapping(ICConfigurationDescription configuration,
String contentType)
Removes the given content type mapping (if it exists).
|
void |
removeFileMapping(ICConfigurationDescription configuration,
org.eclipse.core.resources.IFile file)
Removes the given file mapping (if it exists).
|
void |
removeFileMapping(ICConfigurationDescription configuration,
String filePath)
Removes the given file mapping (if it exists).
|
void |
setContentTypeMappings(Map<String,Map<String,String>> mappings)
This method is used internally by CDT and should not be used outside of the CDT framework.
|
void |
setFileMappings(org.eclipse.core.resources.IFile file,
Map<String,String> mappings)
This method is used internally by CDT and should not be used outside of the CDT framework.
|
void |
setFileMappings(Map<String,Map<String,String>> mappings)
This method is used internally by CDT and should not be used outside of the CDT framework.
|
public ProjectLanguageConfiguration()
ProjectLanguageConfiguration
with no
language mappings defined.public String getLanguageForContentType(ICConfigurationDescription configuration, String contentTypeId)
configuration
is null
, the configuration-agnostic
mapping is returned.public String getLanguageForFile(ICConfigurationDescription configuration, org.eclipse.core.resources.IFile file)
configuration
is null
, the configuration-agnostic
mapping is returned.public String getLanguageForFile(ICConfigurationDescription configuration, String path)
configuration
is null
, the configuration-agnostic
mapping is returned.path
- public void addContentTypeMapping(ICConfigurationDescription configuration, String contentType, String language)
configuration
is not null
, the language mapping
will only apply when that configuration is active. Otherwise, the mapping
will apply for all configurations.contentType
- language
- public void removeContentTypeMapping(ICConfigurationDescription configuration, String contentType)
configuration
is null
, the configuration-agnostic
mapping is removed. Otherwise, the configuration-specific mapping is removed.contentType
- public void addFileMapping(ICConfigurationDescription configuration, org.eclipse.core.resources.IFile file, String language)
configuration
is not null
, the language mapping
will only apply when that configuration is active. Otherwise, the mapping
will apply for all configurations.file
- language
- public void addFileMapping(ICConfigurationDescription configuration, String filePath, String language)
configuration
is not null
, the language mapping
will only apply when that configuration is active. Otherwise, the mapping
will apply for all configurations.filePath
- language
- public void removeFileMapping(ICConfigurationDescription configuration, org.eclipse.core.resources.IFile file)
configuration
is null
, the configuration-agnostic
mapping is removed. Otherwise, the configuration-specific mapping is removed.file
- public void removeFileMapping(ICConfigurationDescription configuration, String filePath)
configuration
is null
, the configuration-agnostic
mapping is removed. Otherwise, the configuration-specific mapping is removed.filePath
- public void removeAllFileMappings(String filePath)
filePath
- public void removeAllFileMappings(org.eclipse.core.resources.IFile file)
file
- public Map<String,Map<String,String>> getContentTypeMappings()
public void setContentTypeMappings(Map<String,Map<String,String>> mappings)
public Map<String,Map<String,String>> getFileMappings()
public void setFileMappings(org.eclipse.core.resources.IFile file, Map<String,String> mappings)
file
- Copyright (c) IBM Corp. and others 2004, 2020. All Rights Reserved.