Interface ILanguageSettingsProvider
-
- All Known Subinterfaces:
ILanguageSettingsBroadcastingProvider,ILanguageSettingsEditableProvider
- All Known Implementing Classes:
LanguageSettingsBaseProvider,LanguageSettingsGenericProvider,LanguageSettingsSerializableProvider
public interface ILanguageSettingsProviderBase interface to provide list ofICLanguageSettingEntry. This interface is used to deliver additions to compiler options such as include paths (-I) or preprocessor defines (-D) and others (seeICSettingEntry.INCLUDE_PATHand other kinds).
To define a provider like that use extension pointorg.eclipse.cdt.core.LanguageSettingsProviderand implement this interface. The recommended way of implementing is to extendLanguageSettingsSerializableProviderand implementILanguageSettingsEditableProvider. That will give the ability to persist and edit/clean entries by user in UI. The clone methods defined byILanguageSettingsEditableProvidershould be chained as done for example byLanguageSettingsGenericProvider.
CDT provides a few general use implementations in the core such asLanguageSettingsBaseProviderorLanguageSettingsSerializableProviderorLanguageSettingsGenericProviderwhich could be used out of the box or built upon. There are also abstract classes in build pluginsAbstractBuildCommandParserandAbstractBuiltinSpecsDetectorwhich serve as a base for output parsers and built-in compiler language settings detectors. See also extension point schema description LanguageSettingsProvider.exsd.- Since:
- 5.4
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.StringgetId()Id is used to keep track of the providers internally.java.lang.StringgetName()Name is used to present the provider to the end user in UI.java.util.List<ICLanguageSettingEntry>getSettingEntries(ICConfigurationDescription cfgDescription, org.eclipse.core.resources.IResource rc, java.lang.String languageId)Returns the list of setting entries for the given configuration description, resource and language.
-
-
-
Method Detail
-
getId
java.lang.String getId()
Id is used to keep track of the providers internally. Use unique id to represent the provider.- Returns:
- Id of the provider.
-
getName
java.lang.String getName()
Name is used to present the provider to the end user in UI.- Returns:
- name of the provider.
-
getSettingEntries
java.util.List<ICLanguageSettingEntry> getSettingEntries(ICConfigurationDescription cfgDescription, org.eclipse.core.resources.IResource rc, java.lang.String languageId)
Returns the list of setting entries for the given configuration description, resource and language.
Note to implementers - this method should not be used to do any long running operations such as extensive calculations or reading files. If you need to do so, the recommended way is to do the calculations outside of this function call - in advance and on appropriate event. For example, Build Output Parser prepares the list and stores it in internal cache while parsing output.getSettingEntries(ICConfigurationDescription, IResource, String)will return cached entries when asked. You can also implementICListenerAgentinterface to get registered and listen to arbitrary events.- Parameters:
cfgDescription- - configuration description.rc- - resource such as file or folder. Ifnull, the default entries for all resources are returned.languageId- - language id. Ifnull, the default entries for all languages are returned. (seeLanguageManager.getLanguageForFile(org.eclipse.core.resources.IFile, ICConfigurationDescription)).- Returns:
- the list of setting entries or
nullif no settings defined. The list needs to be a pooled list created byLanguageSettingsStorage.getPooledList(List)to save memory and avoid deep equality comparisons.
-
-