Interface ICSettingsStorage
- All Known Subinterfaces:
ICConfigurationDescription
,ICMultiConfigDescription
,ICProjectDescription
public interface ICSettingsStorage
This interface represents the settings storage that can be used as the root
of a settings tree of name-attribute-value holder elements (
In real terms this is a specialised node in the project description tree. It is specialised in that it can only contain ICStorageElements as children and has no associated attributes or value. The Xml model implements this as an element called 'storageModule' which contains other arbitrary Xml ICStorageElements.
Both
The format of the storage file is left up to the implementor. It may be an XML file (.cproject) a relational database (.cprojectdb) or any other format of the extenders choosing.
These capabilities are used by the build system for persisting build configuration data as well as by the CoreModel
ICStorageElement
s).
In real terms this is a specialised node in the project description tree. It is specialised in that it can only contain ICStorageElements as children and has no associated attributes or value. The Xml model implements this as an element called 'storageModule' which contains other arbitrary Xml ICStorageElements.
Both
ICProjectDescription
and ICConfigurationDescription
implement this
interface thus providing the capabilities to store custom project-wide and configuration-specific
data in the storage file
The format of the storage file is left up to the implementor. It may be an XML file (.cproject) a relational database (.cprojectdb) or any other format of the extenders choosing.
These capabilities are used by the build system for persisting build configuration data as well as by the CoreModel
ICConfigurationDescription
storage trees. See
CConfigurationDataProvider.loadConfiguration(ICConfigurationDescription, IProgressMonitor)
and CConfigurationDataProvider.applyConfiguration(ICConfigurationDescription, ICConfigurationDescription, CConfigurationData, IProgressMonitor)
- See Also:
- Restriction:
- This interface is not intended to be implemented by clients.
- Restriction:
- This interface is not intended to be extended by clients.
-
Method Summary
Modifier and TypeMethodDescriptiongetStorage
(String id, boolean create) returns the storage of the specified idimportStorage
(String id, ICStorageElement el) Import an existing ICStorageElement storage module into the ICSettingsStorage Returns a handle on the newly imported ICSettingsStorage NB Storage IDs are unique in an ICSettingsStorage.boolean
Returns whether any non-persisted changes exist in this treeboolean
Return whether this Settings Storage is currently read onlyvoid
removeStorage
(String id) Remove the storage module with the given ID from this ICSettingsStoragevoid
setReadOnly
(boolean readOnly, boolean keepModify) Mark this Settings Storage as read only.
-
Method Details
-
getStorage
ICStorageElement getStorage(String id, boolean create) throws org.eclipse.core.runtime.CoreException returns the storage of the specified id- Parameters:
id
- any custom string value uniquely representing the storage- Returns:
ICStorageElement
if the settings storage does not contain the information of the specified id an empty storage is created and returned- Throws:
org.eclipse.core.runtime.CoreException
- See Also:
-
removeStorage
Remove the storage module with the given ID from this ICSettingsStorage- Parameters:
id
-- Throws:
org.eclipse.core.runtime.CoreException
-
importStorage
ICStorageElement importStorage(String id, ICStorageElement el) throws UnsupportedOperationException, org.eclipse.core.runtime.CoreException Import an existing ICStorageElement storage module into the ICSettingsStorage Returns a handle on the newly imported ICSettingsStorage NB Storage IDs are unique in an ICSettingsStorage. Importing a storage will replace any other storage with equivalent id- Parameters:
id
- name of the storage to be importedel
- ICStorageElement to be imported- Returns:
- ICStorageElement representing the imported storage
- Throws:
UnsupportedOperationException
org.eclipse.core.runtime.CoreException
- Since:
- 5.1
-
isModified
boolean isModified()Returns whether any non-persisted changes exist in this tree- Returns:
- boolean indicating whether any elements in this tree have been modified
- Since:
- 5.1
-
isReadOnly
boolean isReadOnly()Return whether this Settings Storage is currently read only- Returns:
- whether this storage is readonly
- Since:
- 5.1
-
setReadOnly
void setReadOnly(boolean readOnly, boolean keepModify) Mark this Settings Storage as read only. If keepModify is set then modified flag will not be reset- Parameters:
readOnly
-keepModify
-- Since:
- 5.1
-