| java.lang.Object org.eclipse.ui.internal.services.RegistryPersistence
All known Subclasses: org.eclipse.ui.internal.services.PreferencePersistence, org.eclipse.ui.internal.menus.LegacyActionPersistence, org.eclipse.ui.internal.commands.CommandImagePersistence, org.eclipse.ui.internal.menus.MenuPersistence, org.eclipse.ui.internal.commands.CommandPersistence, org.eclipse.ui.internal.handlers.HandlerPersistence, org.eclipse.ui.internal.contexts.ContextPersistence,
RegistryPersistence | abstract public class RegistryPersistence implements IDisposable,IWorkbenchRegistryConstants(Code) | |
A manager for items parsed from the registry. This attaches a listener to the
registry after the first read, and monitors the registry for changes from
that point on. When
RegistryPersistence.dispose() is called, the listener is detached.
This class is only intended for internal use within the
org.eclipse.ui.workbench plug-in.
since: 3.2 |
Field Summary | |
final protected static Expression | ERROR_EXPRESSION The expression to return when there is an error. | protected boolean | registryListenerAttached Whether the preference and registry change listeners have been attached
yet. |
Method Summary | |
final protected static void | addElementToIndexedArray(IConfigurationElement elementToAdd, IConfigurationElement[][] indexedArray, int index, int currentCount) Inserts the given element into the indexed two-dimensional array in the
array at the index. | final protected static void | addWarning(List warningsToLog, String message, IConfigurationElement element) Adds a warning to be logged at some later point in time. | final protected static void | addWarning(List warningsToLog, String message, IConfigurationElement element, String id) Adds a warning to be logged at some later point in time. | final protected static void | addWarning(List warningsToLog, String message, IConfigurationElement element, String id, String extraAttributeName, String extraAttributeValue) Adds a warning to be logged at some later point in time. | final protected static boolean | checkClass(IConfigurationElement configurationElement, List warningsToLog, String message, String id) Checks that the class attribute or element exists for this element. | public void | dispose() Detaches the registry change listener from the registry. | abstract protected boolean | isChangeImportant(IRegistryChangeEvent event) Checks whether the registry change could affect this persistence class.
Parameters: event - The event indicating the registry change; must not benull . | final protected static boolean | isPulldown(IConfigurationElement element) Checks to see whether the configuration element represents a pulldown
action. | final protected static void | logWarnings(List warningsToLog, String message) Logs any warnings in warningsToLog . | protected void | read() Reads the various elements from the registry. | final protected static boolean | readBoolean(IConfigurationElement configurationElement, String attribute, boolean defaultValue) Reads a boolean attribute from an element.
Parameters: configurationElement - The configuration element from which to read the attribute;must not be null . Parameters: attribute - The attribute to read; must not be null . Parameters: defaultValue - The default boolean value. | final protected static String | readOptional(IConfigurationElement configurationElement, String attribute) Reads an optional attribute from an element. | final protected static ParameterizedCommand | readParameterizedCommand(IConfigurationElement configurationElement, ICommandService commandService, List warningsToLog, String message, String id) Reads the parameterized command from a parent configuration element. | final protected static ParameterizedCommand | readParameters(IConfigurationElement configurationElement, List warningsToLog, Command command) Reads the parameters from a parent configuration element. | final protected static String | readRequired(IConfigurationElement configurationElement, String attribute, List warningsToLog, String message) Reads a required attribute from the configuration element.
Parameters: configurationElement - The configuration element from which to read; must not benull . Parameters: attribute - The attribute to read; must not be null . Parameters: warningsToLog - The list of warnings; must not be null . Parameters: message - The warning message to use if the attribute is missing; mustnot be null . | final protected static String | readRequired(IConfigurationElement configurationElement, String attribute, List warningsToLog, String message, String id) Reads a required attribute from the configuration element. | final protected static Expression | readWhenElement(IConfigurationElement parentElement, String whenElementName, String id, List warningsToLog) Reads a when child element from the given configuration
element. |
ERROR_EXPRESSION | final protected static Expression ERROR_EXPRESSION(Code) | | The expression to return when there is an error. Never null .
|
registryListenerAttached | protected boolean registryListenerAttached(Code) | | Whether the preference and registry change listeners have been attached
yet.
|
RegistryPersistence | protected RegistryPersistence()(Code) | | Constructs a new instance of
RegistryPersistence . A registry
change listener is created.
|
addElementToIndexedArray | final protected static void addElementToIndexedArray(IConfigurationElement elementToAdd, IConfigurationElement[][] indexedArray, int index, int currentCount)(Code) | | Inserts the given element into the indexed two-dimensional array in the
array at the index. The array is grown as necessary.
Parameters: elementToAdd - The element to add to the indexed array; may benull Parameters: indexedArray - The two-dimensional array that is indexed by element type;must not be null . Parameters: index - The index at which the element should be added; must be avalid index. Parameters: currentCount - The current number of items in the array at the index. |
addWarning | final protected static void addWarning(List warningsToLog, String message, IConfigurationElement element)(Code) | | Adds a warning to be logged at some later point in time.
Parameters: warningsToLog - The collection of warnings to be logged; must not benull . Parameters: message - The mesaage to log; must not be null . Parameters: element - The element from which the warning originates; may benull . |
addWarning | final protected static void addWarning(List warningsToLog, String message, IConfigurationElement element, String id)(Code) | | Adds a warning to be logged at some later point in time. This logs the
identifier of the item.
Parameters: warningsToLog - The collection of warnings to be logged; must not benull . Parameters: message - The mesaage to log; must not be null . Parameters: element - The element from which the warning originates; may benull . Parameters: id - The identifier of the item for which a warning is beinglogged; may be null . |
addWarning | final protected static void addWarning(List warningsToLog, String message, IConfigurationElement element, String id, String extraAttributeName, String extraAttributeValue)(Code) | | Adds a warning to be logged at some later point in time. This logs the
identifier of the item, as well as an extra attribute.
Parameters: warningsToLog - The collection of warnings to be logged; must not benull . Parameters: message - The mesaage to log; must not be null . Parameters: element - The element from which the warning originates; may benull . Parameters: id - The identifier of the item for which a warning is beinglogged; may be null . Parameters: extraAttributeName - The name of extra attribute to be logged; may benull . Parameters: extraAttributeValue - The value of the extra attribute to be logged; may benull . |
checkClass | final protected static boolean checkClass(IConfigurationElement configurationElement, List warningsToLog, String message, String id)(Code) | | Checks that the class attribute or element exists for this element. This
is used for executable extensions that are being read in.
Parameters: configurationElement - The configuration element which should contain a classattribute or a class child element; must not benull . Parameters: warningsToLog - The list of warnings to be logged; never null . Parameters: message - The message to log if something goes wrong; may benull . Parameters: id - The identifier of the handle object; may be null . true if the class attribute or element exists;false otherwise. |
dispose | public void dispose()(Code) | | Detaches the registry change listener from the registry.
|
isChangeImportant | abstract protected boolean isChangeImportant(IRegistryChangeEvent event)(Code) | | Checks whether the registry change could affect this persistence class.
Parameters: event - The event indicating the registry change; must not benull . true if the persistence instance is affected bythis change; false otherwise. |
isPulldown | final protected static boolean isPulldown(IConfigurationElement element)(Code) | | Checks to see whether the configuration element represents a pulldown
action. This involves reading the style and
pulldown attributes.
Parameters: element - The element to check; must not be null . true if the element is a pulldown action;false otherwise. |
logWarnings | final protected static void logWarnings(List warningsToLog, String message)(Code) | | Logs any warnings in warningsToLog .
Parameters: warningsToLog - The warnings to log; may be null . Parameters: message - The message to include in the log entry; must not benull . |
read | protected void read()(Code) | | Reads the various elements from the registry. Subclasses should extend,
but must not override.
|
readBoolean | final protected static boolean readBoolean(IConfigurationElement configurationElement, String attribute, boolean defaultValue)(Code) | | Reads a boolean attribute from an element.
Parameters: configurationElement - The configuration element from which to read the attribute;must not be null . Parameters: attribute - The attribute to read; must not be null . Parameters: defaultValue - The default boolean value. The attribute's value; may be null if none. |
readOptional | final protected static String readOptional(IConfigurationElement configurationElement, String attribute)(Code) | | Reads an optional attribute from an element. This converts zero-length
strings into null .
Parameters: configurationElement - The configuration element from which to read the attribute;must not be null . Parameters: attribute - The attribute to read; must not be null . The attribute's value; may be null if none. |
readParameterizedCommand | final protected static ParameterizedCommand readParameterizedCommand(IConfigurationElement configurationElement, ICommandService commandService, List warningsToLog, String message, String id)(Code) | | Reads the parameterized command from a parent configuration element. This
is used to read the parameter sub-elements from a key element, as well as
the command id. Each parameter is guaranteed to be valid. If invalid
parameters are found, then a warning status will be appended to the
warningsToLog list. The command id is required, or a
warning will be logged.
Parameters: configurationElement - The configuration element from which the parameters should beread; must not be null . Parameters: commandService - The service providing commands for the workbench; must not benull . Parameters: warningsToLog - The list of warnings found during parsing. Warnings found willparsing the parameters will be appended to this list. Thisvalue must not be null . Parameters: message - The message to print if the command identifier is not present;must not be null . The array of parameters found for this configuration element;null if none can be found. |
readParameters | final protected static ParameterizedCommand readParameters(IConfigurationElement configurationElement, List warningsToLog, Command command)(Code) | | Reads the parameters from a parent configuration element. This is used to
read the parameter sub-elements from a key element. Each parameter is
guaranteed to be valid. If invalid parameters are found, then a warning
status will be appended to the warningsToLog list.
Parameters: configurationElement - The configuration element from which the parameters should beread; must not be null . Parameters: warningsToLog - The list of warnings found during parsing. Warnings found willparsing the parameters will be appended to this list. Thisvalue must not be null . Parameters: command - The command around which the parameterization should becreated; must not be null . The array of parameters found for this configuration element;null if none can be found. |
readRequired | final protected static String readRequired(IConfigurationElement configurationElement, String attribute, List warningsToLog, String message)(Code) | | Reads a required attribute from the configuration element.
Parameters: configurationElement - The configuration element from which to read; must not benull . Parameters: attribute - The attribute to read; must not be null . Parameters: warningsToLog - The list of warnings; must not be null . Parameters: message - The warning message to use if the attribute is missing; mustnot be null . The required attribute; may be null if missing. |
readRequired | final protected static String readRequired(IConfigurationElement configurationElement, String attribute, List warningsToLog, String message, String id)(Code) | | Reads a required attribute from the configuration element. This logs the
identifier of the item if this required element cannot be found.
Parameters: configurationElement - The configuration element from which to read; must not benull . Parameters: attribute - The attribute to read; must not be null . Parameters: warningsToLog - The list of warnings; must not be null . Parameters: message - The warning message to use if the attribute is missing; mustnot be null . Parameters: id - The identifier of the element for which this is a requiredattribute; may be null . The required attribute; may be null if missing. |
readWhenElement | final protected static Expression readWhenElement(IConfigurationElement parentElement, String whenElementName, String id, List warningsToLog)(Code) | | Reads a when child element from the given configuration
element. Warnings will be appended to warningsToLog .
Parameters: parentElement - The configuration element which might have a when element as a child; never null . Parameters: whenElementName - The name of the when element to find; never null . Parameters: id - The identifier of the menu element whose when expression is being read; never null . Parameters: warningsToLog - The list of warnings while parsing the extension point; nevernull . The when expression for theconfigurationElement , if any; otherwise,null . |
|
|