Package org.eclipse.cdt.utils.envvar
Class StorableEnvironment
java.lang.Object
org.eclipse.cdt.utils.envvar.StorableEnvironment
- Direct Known Subclasses:
PrefsStorableEnvironment
This class represents the set of environment variables that could be loaded
and stored in XML
- Since:
- 3.0
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionStorableEnvironment(boolean isReadOnly) Create new empty StorableEnvironmentStorableEnvironment(IEnvironmentVariable[] variables, boolean isReadOnly) StorableEnvironment(ICStorageElement element, boolean isReadOnly) Initialize the StorableEnvironment from an ICStorageElement treeStorableEnvironment(StorableEnvironment env, boolean isReadOnly) Copy constructor. -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleancheckVariable(String name, String value, int op, String delimiter) createVariable(String name) createVariable(String name, String value) createVariable(String name, String value, int op, String delimiter) createVariable(String name, String value, String delimiter) voidcreateVriables(IEnvironmentVariable[] vars) booleandeleteVariable(String name) getVariable(String name) booleanReturns the "change" state of the environment.booleanisDirty()Returns the "dirty" state of the environment.booleanvoidvoidserialize(ICStorageElement element) Serialize the Storable enviornment into the ICStorageElement NB assumes that any variables part of the ISerializeInfo will continue to be serializedvoidsetAppendContributedEnvironment(boolean append) voidsetAppendEnvironment(boolean append) voidsetChanged(boolean changed) sets the "change" state of the environmentvoidsetDirty(boolean dirty) sets the "dirty" state of the environmentvoidsetVariales(IEnvironmentVariable[] vars) Set the enviornment variables in thisStorableEnvironment
-
Field Details
-
ENVIRONMENT_ELEMENT_NAME
- See Also:
-
-
Constructor Details
-
StorableEnvironment
- Parameters:
variables-isReadOnly-
-
StorableEnvironment
public StorableEnvironment(boolean isReadOnly) Create new empty StorableEnvironment- Parameters:
isReadOnly-
-
StorableEnvironment
Copy constructor. Creates a new StorableEnvironment from an existing StorableEnvironment. Settings are copied wholesale from the previous enviornment. Note that the previous environment'sStorableEnvironmentLoader.ISerializeInfoisn't copied over, as it's expected this environment's settings will be stored elsewhere- Parameters:
env-isReadOnly-
-
StorableEnvironment
Initialize the StorableEnvironment from an ICStorageElement tree- Parameters:
element-isReadOnly-
-
-
Method Details
-
serialize
Serialize the Storable enviornment into the ICStorageElement NB assumes that any variables part of the ISerializeInfo will continue to be serialized- Parameters:
element-
-
createVariable
-
createVariable
-
createVariable
-
createVariable
-
checkVariable
-
isDirty
public boolean isDirty()Returns the "dirty" state of the environment. If the dirty state istrue, that means that the environment is out of synch with the repository and the environment needs to be serialized.
The dirty state is automatically set tofalsewhen the environment is serialized by calling the serialize() method- Returns:
- boolean
-
setDirty
public void setDirty(boolean dirty) sets the "dirty" state of the environment- Parameters:
dirty- represents the new state
-
isChanged
public boolean isChanged()Returns the "change" state of the environment. The "change" state represents whether the environment was changed or not. This state is not reset when the serialize() method is called Users can use this state to monitor whether the environment was changed or not. This state can be reset tofalseonly by calling the setChanged(false) method- Returns:
- boolean
-
setChanged
public void setChanged(boolean changed) sets the "change" state of the environment- Parameters:
changed- represents the new "change" state
-
getVariable
- Parameters:
name-- Returns:
- the environment variable with the given name, or null
-
setVariales
Set the enviornment variables in thisStorableEnvironment- Parameters:
vars-
-
createVriables
-
getVariables
-
deleteVariable
-
deleteAll
public boolean deleteAll() -
isReadOnly
public boolean isReadOnly() -
appendEnvironment
public boolean appendEnvironment() -
setAppendEnvironment
public void setAppendEnvironment(boolean append) -
appendContributedEnvironment
public boolean appendContributedEnvironment() -
setAppendContributedEnvironment
public void setAppendContributedEnvironment(boolean append) -
restoreDefaults
public void restoreDefaults()
-