| java.lang.Object org.eclipse.ui.internal.services.RegistryPersistence org.eclipse.ui.internal.services.PreferencePersistence
All known Subclasses: org.eclipse.ui.internal.keys.BindingPersistence,
PreferencePersistence | abstract public class PreferencePersistence extends RegistryPersistence (Code) | |
A manager for items parsed from the preference store. This attaches a
listener to the registry after the first read, and monitors the preference
for changes from that point on. When
PreferencePersistence.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 | |
protected boolean | preferenceListenerAttached Whether the preference and registry change listeners have been attached
yet. |
Method Summary | |
final protected static void | addElementToIndexedArray(IMemento elementToAdd, IMemento[][] 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) Adds a warning to be logged at some later point in time. | final protected static void | addWarning(List warningsToLog, String message, String id) Adds a warning to be logged at some later point in time. | final protected static void | addWarning(List warningsToLog, String message, String id, String extraAttributeName, String extraAttributeValue) Adds a warning to be logged at some later point in time. | final public void | dispose() Detaches the preference change listener from the registry. | abstract protected boolean | isChangeImportant(PropertyChangeEvent event) Checks whether the preference change could affect this persistence class.
Parameters: event - The event indicating the preference change; must not benull . | protected void | read() Reads the various elements from the registry. | final protected static boolean | readBoolean(IMemento memento, String attribute, boolean defaultValue) Reads a boolean attribute from a memnto.
Parameters: memento - The memento from which to read the attribute; must not benull . Parameters: attribute - The attribute to read; must not be null . Parameters: defaultValue - The default boolean value. | final protected static String | readOptional(IMemento memento, String attribute) Reads an optional attribute from a memento. | final protected static ParameterizedCommand | readParameterizedCommand(IMemento memento, ICommandService commandService, List warningsToLog, String message, String id) Reads the parameterized command from a parent memento. | final protected static ParameterizedCommand | readParameters(IMemento memento, List warningsToLog, Command command) Reads the parameters from a parent memento. | final protected static String | readRequired(IMemento memento, String attribute, List warningsToLog, String message) Reads a required attribute from the memento.
Parameters: memento - The memento from which to read; must not be null . 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(IMemento memento, String attribute, List warningsToLog, String message, String id) Reads a required attribute from the memento. |
preferenceListenerAttached | protected boolean preferenceListenerAttached(Code) | | Whether the preference and registry change listeners have been attached
yet.
|
PreferencePersistence | protected PreferencePersistence()(Code) | | Constructs a new instance of
PreferencePersistence . A preference
change listener is created.
|
addElementToIndexedArray | final protected static void addElementToIndexedArray(IMemento elementToAdd, IMemento[][] 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)(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 . |
addWarning | final protected static void addWarning(List warningsToLog, String message, 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: 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, 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: 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 . |
dispose | final public void dispose()(Code) | | Detaches the preference change listener from the registry.
|
isChangeImportant | abstract protected boolean isChangeImportant(PropertyChangeEvent event)(Code) | | Checks whether the preference change could affect this persistence class.
Parameters: event - The event indicating the preference change; must not benull . true if the persistence instance is affected bythis change; false otherwise. |
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(IMemento memento, String attribute, boolean defaultValue)(Code) | | Reads a boolean attribute from a memnto.
Parameters: memento - The memento from which to read the attribute; must not benull . 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(IMemento memento, String attribute)(Code) | | Reads an optional attribute from a memento. This converts zero-length
strings into null .
Parameters: memento - The memento from which to read the attribute; must not benull . 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(IMemento memento, ICommandService commandService, List warningsToLog, String message, String id)(Code) | | Reads the parameterized command from a parent memento. 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: memento - The memento from which the parameters should be read; must notbe 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(IMemento memento, List warningsToLog, Command command)(Code) | | Reads the parameters from a parent memento. 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: memento - The memento from which the parameters should be read; must notbe 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 memento; null if none can be found. |
readRequired | final protected static String readRequired(IMemento memento, String attribute, List warningsToLog, String message)(Code) | | Reads a required attribute from the memento.
Parameters: memento - The memento from which to read; must not be null . 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(IMemento memento, String attribute, List warningsToLog, String message, String id)(Code) | | Reads a required attribute from the memento. This logs the identifier of
the item if this required element cannot be found.
Parameters: memento - The memento from which to read; must not be null . 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. |
Fields inherited from org.eclipse.ui.internal.services.RegistryPersistence | final protected static Expression ERROR_EXPRESSION(Code)(Java Doc) protected boolean registryListenerAttached(Code)(Java Doc)
|
Methods inherited from org.eclipse.ui.internal.services.RegistryPersistence | final protected static void addElementToIndexedArray(IConfigurationElement elementToAdd, IConfigurationElement[][] indexedArray, int index, int currentCount)(Code)(Java Doc) final protected static void addWarning(List warningsToLog, String message, IConfigurationElement element)(Code)(Java Doc) final protected static void addWarning(List warningsToLog, String message, IConfigurationElement element, String id)(Code)(Java Doc) final protected static void addWarning(List warningsToLog, String message, IConfigurationElement element, String id, String extraAttributeName, String extraAttributeValue)(Code)(Java Doc) final protected static boolean checkClass(IConfigurationElement configurationElement, List warningsToLog, String message, String id)(Code)(Java Doc) public void dispose()(Code)(Java Doc) abstract protected boolean isChangeImportant(IRegistryChangeEvent event)(Code)(Java Doc) final protected static boolean isPulldown(IConfigurationElement element)(Code)(Java Doc) final protected static void logWarnings(List warningsToLog, String message)(Code)(Java Doc) protected void read()(Code)(Java Doc) final protected static boolean readBoolean(IConfigurationElement configurationElement, String attribute, boolean defaultValue)(Code)(Java Doc) final protected static String readOptional(IConfigurationElement configurationElement, String attribute)(Code)(Java Doc) final protected static ParameterizedCommand readParameterizedCommand(IConfigurationElement configurationElement, ICommandService commandService, List warningsToLog, String message, String id)(Code)(Java Doc) final protected static ParameterizedCommand readParameters(IConfigurationElement configurationElement, List warningsToLog, Command command)(Code)(Java Doc) final protected static String readRequired(IConfigurationElement configurationElement, String attribute, List warningsToLog, String message)(Code)(Java Doc) final protected static String readRequired(IConfigurationElement configurationElement, String attribute, List warningsToLog, String message, String id)(Code)(Java Doc) final protected static Expression readWhenElement(IConfigurationElement parentElement, String whenElementName, String id, List warningsToLog)(Code)(Java Doc)
|
|
|