public abstract class RegistryReader extends Object implements org.eclipse.core.runtime.IRegistryChangeListener
readRegistry.
To read children of an IConfigurationElement, call the method
readElementChildren from your implementation of the method
readElement, as it will not be done by default.| Modifier and Type | Field and Description |
|---|---|
protected static String |
TAG_DESCRIPTION |
| Modifier | Constructor and Description |
|---|---|
protected |
RegistryReader(org.eclipse.core.runtime.IExtensionRegistry registry,
String pluginId,
String extensionPoint)
The constructor.
|
protected |
RegistryReader(String pluginId,
String extensionPoint)
The constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected String |
getDescription(org.eclipse.core.runtime.IConfigurationElement config)
This method extracts description as a subelement of the given element.
|
protected static void |
logError(org.eclipse.core.runtime.IConfigurationElement element,
String text)
Logs the error in the workbench log using the provided text and the
information in the configuration element.
|
protected static void |
logMissingAttribute(org.eclipse.core.runtime.IConfigurationElement element,
String attributeName)
Logs a very common registry error when a required attribute is missing.
|
protected static void |
logMissingElement(org.eclipse.core.runtime.IConfigurationElement element,
String elementName)
Logs a very common registry error when a required child is missing.
|
protected static void |
logUnknownElement(org.eclipse.core.runtime.IConfigurationElement element)
Logs a registry error when the configuration element is unknown.
|
protected org.eclipse.core.runtime.IExtension[] |
orderExtensions(org.eclipse.core.runtime.IExtension[] extensions)
Apply a reproducable order to the list of extensions provided, such that
the order will not change as extensions are added or removed.
|
protected boolean |
readElement(org.eclipse.core.runtime.IConfigurationElement element)
Implement this method to read element's attributes.
|
protected boolean |
readElement(org.eclipse.core.runtime.IConfigurationElement element,
boolean add)
Implement this method to read element attributes for the purpose of
adding or removing their registrations.
|
protected void |
readElementChildren(org.eclipse.core.runtime.IConfigurationElement element,
boolean add)
Read the element's children.
|
protected void |
readElements(org.eclipse.core.runtime.IConfigurationElement[] elements,
boolean add)
Read each element one at a time by calling the subclass implementation of
readElement. |
protected void |
readExtension(org.eclipse.core.runtime.IExtension extension,
boolean add)
Read one extension by looping through its configuration elements.
|
void |
readRegistry()
Start the registry reading process using the supplied plugin ID and
extension point.
|
void |
registerListener()
Registers change listener to extension registry
|
void |
registryChanged(org.eclipse.core.runtime.IRegistryChangeEvent event) |
void |
unregisterListener()
Unregisters change listener from extension registry
|
protected static final String TAG_DESCRIPTION
protected RegistryReader(org.eclipse.core.runtime.IExtensionRegistry registry,
String pluginId,
String extensionPoint)
protected String getDescription(org.eclipse.core.runtime.IConfigurationElement config)
protected static void logError(org.eclipse.core.runtime.IConfigurationElement element,
String text)
protected static void logMissingAttribute(org.eclipse.core.runtime.IConfigurationElement element,
String attributeName)
protected static void logMissingElement(org.eclipse.core.runtime.IConfigurationElement element,
String elementName)
protected static void logUnknownElement(org.eclipse.core.runtime.IConfigurationElement element)
protected org.eclipse.core.runtime.IExtension[] orderExtensions(org.eclipse.core.runtime.IExtension[] extensions)
protected boolean readElement(org.eclipse.core.runtime.IConfigurationElement element)
readElementChildren. Implementor is also responsible for
logging missing attributes.protected boolean readElement(org.eclipse.core.runtime.IConfigurationElement element,
boolean add)
protected void readElementChildren(org.eclipse.core.runtime.IConfigurationElement element,
boolean add)
protected void readElements(org.eclipse.core.runtime.IConfigurationElement[] elements,
boolean add)
readElement.
Logs an error if the element was not recognized.protected void readExtension(org.eclipse.core.runtime.IExtension extension,
boolean add)
public void readRegistry()
public void registerListener()
public void unregisterListener()
public void registryChanged(org.eclipse.core.runtime.IRegistryChangeEvent event)
registryChanged in interface org.eclipse.core.runtime.IRegistryChangeListenerCopyright © 2020 Fraunhofer IWU. All rights reserved.