Package org.eclipse.cdt.core.model
Class LanguageManager
java.lang.Object
org.eclipse.cdt.core.model.LanguageManager
- Restriction:
- This interface is not intended to be extended by clients.
- Restriction:
- This class is not intended to be instantiated by clients.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionDeprecated.use getRegisteredContentTypes() instead.getContributedModelBuilderFor
(org.eclipse.cdt.internal.core.model.TranslationUnit tu) Deprecated.usegetContributedModelBuilderFor(ITranslationUnit)
, instead.static LanguageManager
getLanguage
(String id) getLanguage
(org.eclipse.core.runtime.content.IContentType contentType) getLanguage
(org.eclipse.core.runtime.content.IContentType contentType, org.eclipse.core.resources.IProject project) Returns language binding to a particular content type for given project.getLanguage
(org.eclipse.core.runtime.content.IContentType contentType, org.eclipse.core.resources.IProject project, ICConfigurationDescription configurationDescription) Returns language binding to a particular content type for given project.getLanguageConfiguration
(org.eclipse.core.resources.IProject project) Returns the language configuration for the given project.getLanguageForContentTypeID
(String contentTypeID) getLanguageForFile
(String fullPathToFile, org.eclipse.core.resources.IProject project, ICConfigurationDescription configuration) Returns an ILanguage representing the language to be used for the given file.getLanguageForFile
(org.eclipse.core.resources.IFile file, ICConfigurationDescription configuration) Returns an ILanguage representing the language to be used for the given file.getLanguageForFile
(org.eclipse.core.resources.IFile file, ICConfigurationDescription configuration, String contentTypeId) Returns an ILanguage representing the language to be used for the given file.getLanguageForFile
(org.eclipse.core.runtime.IPath pathToFile, org.eclipse.core.resources.IProject project, ICConfigurationDescription configuration) Returns an ILanguage representing the language to be used for the given file.getLanguageForFile
(org.eclipse.core.runtime.IPath pathToFile, org.eclipse.core.resources.IProject project, ICConfigurationDescription configuration, String contentTypeID) Returns an ILanguage representing the language to be used for the given file.Returns mappings between IDs and IPDOMLinkageFactory.String[]
Returns all content types that are registered with CDT.Returns all of the languages registered with thePlatform
.Returns the language configuration for the workspace.boolean
isContributedContentType
(String contentTypeId) void
Notifies all language mappings change listeners of a change in the mappings.void
Adds a listener that will be notified of changes in language mappings.void
storeLanguageMappingConfiguration
(org.eclipse.core.resources.IFile file) Saves the language configuration for the given file to persistent storage and notifies allILanguageMappingChangeListeners
of changes.void
storeLanguageMappingConfiguration
(org.eclipse.core.resources.IProject project, org.eclipse.core.runtime.content.IContentType[] affectedContentTypes) Saves the language configuration for the given project to persistent storage and notifies allILanguageMappingChangeListeners
of changes.void
storeWorkspaceLanguageConfiguration
(org.eclipse.core.runtime.content.IContentType[] affectedContentTypes) Saves the workspace language configuration to persistent storage and notifies allILanguageMappingChangeListeners
of changes.void
Removes a language mapping change listener.
-
Constructor Details
-
LanguageManager
public LanguageManager()
-
-
Method Details
-
getInstance
-
getLanguageDescriptor
-
getLanguageDescriptors
-
getContentTypeIdToLanguageDescriptionsMap
-
getLanguage
-
getLanguage
-
getLanguageForContentTypeID
-
getAllContentTypes
Deprecated.use getRegisteredContentTypes() instead. -
getRegisteredContentTypeIds
Returns all content types that are registered with CDT.- Since:
- 3.1.1
-
isContributedContentType
-
getContributedModelBuilderFor
@Deprecated public IContributedModelBuilder getContributedModelBuilderFor(org.eclipse.cdt.internal.core.model.TranslationUnit tu) Deprecated.usegetContributedModelBuilderFor(ITranslationUnit)
, instead.- Restriction:
- This method is not intended to be referenced by clients.
-
getContributedModelBuilderFor
- Since:
- 5.1
-
getPDOMLinkageFactoryMappings
public Map<String,org.eclipse.cdt.internal.core.pdom.dom.IPDOMLinkageFactory> getPDOMLinkageFactoryMappings()Returns mappings between IDs and IPDOMLinkageFactory. The IDs are defined inILinkage
.- Returns:
- a map.
- Since:
- 4.0
-
getRegisteredLanguages
Returns all of the languages registered with thePlatform
.- Returns:
- all of the languages registered with the
Platform
.
-
getWorkspaceLanguageConfiguration
public WorkspaceLanguageConfiguration getWorkspaceLanguageConfiguration() throws org.eclipse.core.runtime.CoreExceptionReturns the language configuration for the workspace.- Returns:
- the language configuration for the workspace
- Throws:
org.eclipse.core.runtime.CoreException
- Since:
- 4.0
-
storeWorkspaceLanguageConfiguration
public void storeWorkspaceLanguageConfiguration(org.eclipse.core.runtime.content.IContentType[] affectedContentTypes) throws org.eclipse.core.runtime.CoreException Saves the workspace language configuration to persistent storage and notifies allILanguageMappingChangeListeners
of changes.- Parameters:
affectedContentTypes
-- Throws:
org.eclipse.core.runtime.CoreException
- Since:
- 4.0
-
getLanguageConfiguration
public ProjectLanguageConfiguration getLanguageConfiguration(org.eclipse.core.resources.IProject project) throws org.eclipse.core.runtime.CoreException Returns the language configuration for the given project.- Parameters:
project
-- Returns:
- the language configuration for the given project
- Throws:
org.eclipse.core.runtime.CoreException
- Since:
- 4.0
-
storeLanguageMappingConfiguration
public void storeLanguageMappingConfiguration(org.eclipse.core.resources.IProject project, org.eclipse.core.runtime.content.IContentType[] affectedContentTypes) throws org.eclipse.core.runtime.CoreException Saves the language configuration for the given project to persistent storage and notifies allILanguageMappingChangeListeners
of changes.- Parameters:
project
-affectedContentTypes
-- Throws:
org.eclipse.core.runtime.CoreException
- Since:
- 4.0
-
getLanguageForFile
public ILanguage getLanguageForFile(String fullPathToFile, org.eclipse.core.resources.IProject project, ICConfigurationDescription configuration) throws org.eclipse.core.runtime.CoreException Returns an ILanguage representing the language to be used for the given file.- Parameters:
fullPathToFile
- the full path to the file for which the language is requestedproject
- the IProject that this file is in the context of. This field cannot be null.configuration
- the active build configuration, ornull
if build configurations are not relevant to determining the language.- Returns:
- an ILanguage representing the language to be used for the given file
- Throws:
org.eclipse.core.runtime.CoreException
- Since:
- 4.0
-
getLanguageForFile
public ILanguage getLanguageForFile(org.eclipse.core.runtime.IPath pathToFile, org.eclipse.core.resources.IProject project, ICConfigurationDescription configuration) throws org.eclipse.core.runtime.CoreException Returns an ILanguage representing the language to be used for the given file.- Parameters:
pathToFile
- the path to the file for which the language is requested. The path can be either workspace or project relative.project
- the project that this file should be parsed in context of. This field is optional and may be set to null. If the project is null then this method tries to determine the project context via workspace APIs.configuration
- the active build configuration, ornull
if build configurations are not relevant to determining the language.- Returns:
- an ILanguage representing the language to be used for the given file
- Throws:
org.eclipse.core.runtime.CoreException
- Since:
- 4.0
-
getLanguageForFile
public ILanguage getLanguageForFile(org.eclipse.core.runtime.IPath pathToFile, org.eclipse.core.resources.IProject project, ICConfigurationDescription configuration, String contentTypeID) throws org.eclipse.core.runtime.CoreException Returns an ILanguage representing the language to be used for the given file.- Parameters:
pathToFile
- the path to the file for which the language is requested. The path can be either workspace or project relative.project
- the project that this file should be parsed in context of. This field is optional and may be set to null. If the project is null then this method tries to determine the project context via workspace APIs.configuration
- the active build configuration, ornull
if build configurations are not relevant to determining the language.contentTypeID
- id of the content type, may benull
.- Returns:
- an ILanguage representing the language to be used for the given file
- Throws:
org.eclipse.core.runtime.CoreException
- Since:
- 4.0
-
getLanguageForFile
public ILanguage getLanguageForFile(org.eclipse.core.resources.IFile file, ICConfigurationDescription configuration) throws org.eclipse.core.runtime.CoreException Returns an ILanguage representing the language to be used for the given file.- Parameters:
file
- the file for which the language is requestedconfiguration
- the active build configuration, ornull
if build configurations are not relevant to determining the language.- Returns:
- an ILanguage representing the language to be used for the given file
- Throws:
org.eclipse.core.runtime.CoreException
- Since:
- 4.0
-
getLanguageForFile
public ILanguage getLanguageForFile(org.eclipse.core.resources.IFile file, ICConfigurationDescription configuration, String contentTypeId) throws org.eclipse.core.runtime.CoreException Returns an ILanguage representing the language to be used for the given file.- Parameters:
file
- the file for which the language is requestedconfiguration
- the active build configuration, ornull
if build configurations are not relevant to determining the language.contentTypeId
- id of the content type, may benull
.- Returns:
- an ILanguage representing the language to be used for the given file
- Throws:
org.eclipse.core.runtime.CoreException
- Since:
- 4.0
-
registerLanguageChangeListener
Adds a listener that will be notified of changes in language mappings.- Parameters:
listener
- the ILanguageMappingChangeListener to add
-
unregisterLanguageChangeListener
Removes a language mapping change listener.- Parameters:
listener
- the ILanguageMappingChangeListener to remove.
-
notifyLanguageChangeListeners
Notifies all language mappings change listeners of a change in the mappings.- Parameters:
event
- the ILanguageMappingsChange event to be broadcast.
-
storeLanguageMappingConfiguration
public void storeLanguageMappingConfiguration(org.eclipse.core.resources.IFile file) throws org.eclipse.core.runtime.CoreException Saves the language configuration for the given file to persistent storage and notifies allILanguageMappingChangeListeners
of changes.- Parameters:
file
-- Throws:
org.eclipse.core.runtime.CoreException
- Since:
- 4.0
-
getLanguage
public ILanguage getLanguage(org.eclipse.core.runtime.content.IContentType contentType, org.eclipse.core.resources.IProject project) Returns language binding to a particular content type for given project. This method will check project settings, workspace settings and default bindings (in that order)- Parameters:
contentType
- content type of the fileproject
- C/C++ workspace project- Returns:
- CDT language object
- Since:
- 5.4
-
getLanguage
public ILanguage getLanguage(org.eclipse.core.runtime.content.IContentType contentType, org.eclipse.core.resources.IProject project, ICConfigurationDescription configurationDescription) Returns language binding to a particular content type for given project. This method will check project settings, workspace settings and default bindings (in that order)- Parameters:
contentType
- content type of the fileproject
- C/C++ workspace projectconfigurationDescription
- build configuration ornull
- Returns:
- CDT language object
- Since:
- 5.4
-