Package org.eclipse.cdt.core.model
Class LanguageManager
- java.lang.Object
-
- org.eclipse.cdt.core.model.LanguageManager
-
public class LanguageManager extends java.lang.Object- Restriction:
- This interface is not intended to be extended by clients.
- Restriction:
- This class is not intended to be instantiated by clients.
-
-
Constructor Summary
Constructors Constructor Description LanguageManager()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description java.util.ArrayList<java.lang.String>getAllContentTypes()Deprecated.use getRegisteredContentTypes() instead.java.util.Map<java.lang.String,ILanguageDescriptor[]>getContentTypeIdToLanguageDescriptionsMap()IContributedModelBuildergetContributedModelBuilderFor(ITranslationUnit tu)IContributedModelBuildergetContributedModelBuilderFor(org.eclipse.cdt.internal.core.model.TranslationUnit tu)Deprecated.usegetContributedModelBuilderFor(ITranslationUnit), instead.static LanguageManagergetInstance()ILanguagegetLanguage(java.lang.String id)ILanguagegetLanguage(org.eclipse.core.runtime.content.IContentType contentType)ILanguagegetLanguage(org.eclipse.core.runtime.content.IContentType contentType, org.eclipse.core.resources.IProject project)Returns language binding to a particular content type for given project.ILanguagegetLanguage(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.ProjectLanguageConfigurationgetLanguageConfiguration(org.eclipse.core.resources.IProject project)Returns the language configuration for the given project.ILanguageDescriptorgetLanguageDescriptor(java.lang.String id)ILanguageDescriptor[]getLanguageDescriptors()ILanguagegetLanguageForContentTypeID(java.lang.String contentTypeID)ILanguagegetLanguageForFile(java.lang.String fullPathToFile, org.eclipse.core.resources.IProject project, ICConfigurationDescription configuration)Returns an ILanguage representing the language to be used for the given file.ILanguagegetLanguageForFile(org.eclipse.core.resources.IFile file, ICConfigurationDescription configuration)Returns an ILanguage representing the language to be used for the given file.ILanguagegetLanguageForFile(org.eclipse.core.resources.IFile file, ICConfigurationDescription configuration, java.lang.String contentTypeId)Returns an ILanguage representing the language to be used for the given file.ILanguagegetLanguageForFile(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.ILanguagegetLanguageForFile(org.eclipse.core.runtime.IPath pathToFile, org.eclipse.core.resources.IProject project, ICConfigurationDescription configuration, java.lang.String contentTypeID)Returns an ILanguage representing the language to be used for the given file.java.util.Map<java.lang.String,org.eclipse.cdt.internal.core.pdom.dom.IPDOMLinkageFactory>getPDOMLinkageFactoryMappings()Returns mappings between IDs and IPDOMLinkageFactory.java.lang.String[]getRegisteredContentTypeIds()Returns all content types that are registered with CDT.ILanguage[]getRegisteredLanguages()Returns all of the languages registered with thePlatform.WorkspaceLanguageConfigurationgetWorkspaceLanguageConfiguration()Returns the language configuration for the workspace.booleanisContributedContentType(java.lang.String contentTypeId)voidnotifyLanguageChangeListeners(ILanguageMappingChangeEvent event)Notifies all language mappings change listeners of a change in the mappings.voidregisterLanguageChangeListener(ILanguageMappingChangeListener listener)Adds a listener that will be notified of changes in language mappings.voidstoreLanguageMappingConfiguration(org.eclipse.core.resources.IFile file)Saves the language configuration for the given file to persistent storage and notifies allILanguageMappingChangeListenersof changes.voidstoreLanguageMappingConfiguration(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 allILanguageMappingChangeListenersof changes.voidstoreWorkspaceLanguageConfiguration(org.eclipse.core.runtime.content.IContentType[] affectedContentTypes)Saves the workspace language configuration to persistent storage and notifies allILanguageMappingChangeListenersof changes.voidunregisterLanguageChangeListener(ILanguageMappingChangeListener listener)Removes a language mapping change listener.
-
-
-
Method Detail
-
getInstance
public static LanguageManager getInstance()
-
getLanguageDescriptor
public ILanguageDescriptor getLanguageDescriptor(java.lang.String id)
-
getLanguageDescriptors
public ILanguageDescriptor[] getLanguageDescriptors()
-
getContentTypeIdToLanguageDescriptionsMap
public java.util.Map<java.lang.String,ILanguageDescriptor[]> getContentTypeIdToLanguageDescriptionsMap()
-
getLanguage
public ILanguage getLanguage(java.lang.String id)
-
getLanguage
public ILanguage getLanguage(org.eclipse.core.runtime.content.IContentType contentType)
-
getLanguageForContentTypeID
public ILanguage getLanguageForContentTypeID(java.lang.String contentTypeID)
-
getAllContentTypes
@Deprecated public java.util.ArrayList<java.lang.String> getAllContentTypes()
Deprecated.use getRegisteredContentTypes() instead.
-
getRegisteredContentTypeIds
public java.lang.String[] getRegisteredContentTypeIds()
Returns all content types that are registered with CDT.- Since:
- 3.1.1
-
isContributedContentType
public boolean isContributedContentType(java.lang.String contentTypeId)
-
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
public IContributedModelBuilder getContributedModelBuilderFor(ITranslationUnit tu)
- Since:
- 5.1
-
getPDOMLinkageFactoryMappings
public java.util.Map<java.lang.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
public ILanguage[] 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.CoreException
Returns 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.CoreExceptionSaves the workspace language configuration to persistent storage and notifies allILanguageMappingChangeListenersof 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.CoreExceptionSaves the language configuration for the given project to persistent storage and notifies allILanguageMappingChangeListenersof changes.- Parameters:
project-affectedContentTypes-- Throws:
org.eclipse.core.runtime.CoreException- Since:
- 4.0
-
getLanguageForFile
public ILanguage getLanguageForFile(java.lang.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, ornullif 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, ornullif 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, java.lang.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, ornullif 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, ornullif 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, java.lang.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, ornullif 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
public void registerLanguageChangeListener(ILanguageMappingChangeListener listener)
Adds a listener that will be notified of changes in language mappings.- Parameters:
listener- the ILanguageMappingChangeListener to add
-
unregisterLanguageChangeListener
public void unregisterLanguageChangeListener(ILanguageMappingChangeListener listener)
Removes a language mapping change listener.- Parameters:
listener- the ILanguageMappingChangeListener to remove.
-
notifyLanguageChangeListeners
public void notifyLanguageChangeListeners(ILanguageMappingChangeEvent event)
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.CoreExceptionSaves the language configuration for the given file to persistent storage and notifies allILanguageMappingChangeListenersof 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
-
-