public class LanguageSettingsBaseProvider extends AbstractExecutableExtensionBase implements ILanguageSettingsProvider
LanguageSettingsBaseProvider
is a basic implementation of ILanguageSettingsProvider
for the extensions defined by org.eclipse.cdt.core.LanguageSettingsProvider
extension point.
This implementation supports "static" list of entries for languages specified in
the extension point.Modifier and Type | Field and Description |
---|---|
protected List<String> |
languageScope
Language scope, i.e.
|
protected Map<String,String> |
properties
Provider-specific properties
|
Constructor and Description |
---|
LanguageSettingsBaseProvider()
Default constructor.
|
LanguageSettingsBaseProvider(String id,
String name)
Constructor.
|
LanguageSettingsBaseProvider(String id,
String name,
List<String> languages,
List<ICLanguageSettingEntry> entries)
Constructor.
|
LanguageSettingsBaseProvider(String id,
String name,
List<String> languages,
List<ICLanguageSettingEntry> entries,
Map<String,String> properties)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
configureProvider(String id,
String name,
List<String> languages,
List<ICLanguageSettingEntry> entries,
Map<String,String> properties)
A method to configure the provider.
|
boolean |
equals(Object obj) |
List<String> |
getLanguageScope() |
String |
getProperty(String key)
LanguageSettingsBaseProvider keeps the list of key-value pairs
so extenders of this class can customize the provider. |
boolean |
getPropertyBool(String key)
Convenience method to get boolean property.
|
List<ICLanguageSettingEntry> |
getSettingEntries(ICConfigurationDescription cfgDescription,
org.eclipse.core.resources.IResource rc,
String languageId)
Returns the list of setting entries for the given configuration description,
resource and language.
|
int |
hashCode() |
getId, getName, setId, setName, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getId, getName
protected List<String> languageScope
public LanguageSettingsBaseProvider()
public LanguageSettingsBaseProvider(String id, String name)
id
- - id of the provider.name
- - name of the provider to be presented to a user.public LanguageSettingsBaseProvider(String id, String name, List<String> languages, List<ICLanguageSettingEntry> entries)
id
- - id of the provider.name
- - name of the provider to be presented to a user.languages
- - list of languages the entries
provided for.
languages
can be null
, in this case the entries
are provided for any language.entries
- - the list of language settings entries this provider provides.
If null
is passed, the provider creates an empty list.public LanguageSettingsBaseProvider(String id, String name, List<String> languages, List<ICLanguageSettingEntry> entries, Map<String,String> properties)
id
- - id of the provider.name
- - name of the provider to be presented to a user.languages
- - list of languages the entries
provided for.
languages
can be null
, in this case the entries
are provided for any language.entries
- - the list of language settings entries this provider provides.
If null
is passed, the provider creates an empty list.properties
- - custom properties as the means to customize providers.public void configureProvider(String id, String name, List<String> languages, List<ICLanguageSettingEntry> entries, Map<String,String> properties)
id
- - id of the provider.name
- - name of the provider to be presented to a user.languages
- - list of languages the entries
provided for.
languages
can be null
, in this case the entries
are provided for any language.entries
- - the list of language settings entries this provider provides.
If null
is passed, the provider creates an empty list.properties
- - custom properties as the means to customize providers.UnsupportedOperationException
- if an attempt to reconfigure provider is made.public String getProperty(String key)
LanguageSettingsBaseProvider
keeps the list of key-value pairs
so extenders of this class can customize the provider. The properties
of LanguageSettingsBaseProvider
come from the extension in plugin.xml
although the extenders can provide their own method.
null
and the same as missing property, which allows
equals(Object)
evaluate the property as equal while comparing providers.key
- - property to check the value.public boolean getPropertyBool(String key)
key
- - property to check the value.false
.getProperty(String)
public List<ICLanguageSettingEntry> getSettingEntries(ICConfigurationDescription cfgDescription, org.eclipse.core.resources.IResource rc, String languageId)
ILanguageSettingsProvider.getSettingEntries(ICConfigurationDescription, IResource, String)
will
return cached entries when asked. You can also implement ICListenerAgent
interface to get registered and listen to arbitrary events.getSettingEntries
in interface ILanguageSettingsProvider
languageId
- - language id. If null
, then entries defined for
the language scope are returned. See getLanguageScope()
cfgDescription
- - configuration description.rc
- - resource such as file or folder.
If null
, the default entries for all resources are returned.null
if no settings defined.
the list is internally pooled and guaranteed to be the same object for equal
lists.public List<String> getLanguageScope()
null
, the provider provides for any language.public boolean equals(Object obj)
equals
in class Object
true
if the objects are equal, false
otherwise.Object.equals(java.lang.Object)
Copyright (c) IBM Corp. and others 2004, 2020. All Rights Reserved.