Package org.eclipse.cdt.utils.envvar
Class StorableEnvironment
- java.lang.Object
-
- org.eclipse.cdt.utils.envvar.StorableEnvironment
-
- Direct Known Subclasses:
PrefsStorableEnvironment
public class StorableEnvironment extends java.lang.ObjectThis class represents the set of environment variables that could be loaded and stored in XML- Since:
- 3.0
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringENVIRONMENT_ELEMENT_NAME
-
Constructor Summary
Constructors Constructor Description StorableEnvironment(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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanappendContributedEnvironment()booleanappendEnvironment()IEnvironmentVariablecheckVariable(java.lang.String name, java.lang.String value, int op, java.lang.String delimiter)IEnvironmentVariablecreateVariable(java.lang.String name)IEnvironmentVariablecreateVariable(java.lang.String name, java.lang.String value)IEnvironmentVariablecreateVariable(java.lang.String name, java.lang.String value, int op, java.lang.String delimiter)IEnvironmentVariablecreateVariable(java.lang.String name, java.lang.String value, java.lang.String delimiter)voidcreateVriables(IEnvironmentVariable[] vars)booleandeleteAll()IEnvironmentVariabledeleteVariable(java.lang.String name)IEnvironmentVariablegetVariable(java.lang.String name)IEnvironmentVariable[]getVariables()booleanisChanged()Returns the "change" state of the environment.booleanisDirty()Returns the "dirty" state of the environment.booleanisReadOnly()voidrestoreDefaults()voidserialize(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 Detail
-
ENVIRONMENT_ELEMENT_NAME
public static final java.lang.String ENVIRONMENT_ELEMENT_NAME
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
StorableEnvironment
public StorableEnvironment(IEnvironmentVariable[] variables, boolean isReadOnly)
- Parameters:
variables-isReadOnly-
-
StorableEnvironment
public StorableEnvironment(boolean isReadOnly)
Create new empty StorableEnvironment- Parameters:
isReadOnly-
-
StorableEnvironment
public StorableEnvironment(StorableEnvironment env, boolean isReadOnly)
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
public StorableEnvironment(ICStorageElement element, boolean isReadOnly)
Initialize the StorableEnvironment from an ICStorageElement tree- Parameters:
element-isReadOnly-
-
-
Method Detail
-
serialize
public void serialize(ICStorageElement element)
Serialize the Storable enviornment into the ICStorageElement NB assumes that any variables part of the ISerializeInfo will continue to be serialized- Parameters:
element-
-
createVariable
public IEnvironmentVariable createVariable(java.lang.String name, java.lang.String value, int op, java.lang.String delimiter)
-
createVariable
public IEnvironmentVariable createVariable(java.lang.String name)
-
createVariable
public IEnvironmentVariable createVariable(java.lang.String name, java.lang.String value)
-
createVariable
public IEnvironmentVariable createVariable(java.lang.String name, java.lang.String value, java.lang.String delimiter)
-
checkVariable
public IEnvironmentVariable checkVariable(java.lang.String name, java.lang.String value, int op, java.lang.String delimiter)
-
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
public IEnvironmentVariable getVariable(java.lang.String name)
- Parameters:
name-- Returns:
- the environment variable with the given name, or null
-
setVariales
public void setVariales(IEnvironmentVariable[] vars)
Set the enviornment variables in thisStorableEnvironment- Parameters:
vars-
-
createVriables
public void createVriables(IEnvironmentVariable[] vars)
-
getVariables
public IEnvironmentVariable[] getVariables()
-
deleteVariable
public IEnvironmentVariable deleteVariable(java.lang.String name)
-
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()
-
-