Class StorableEnvironment

java.lang.Object
org.eclipse.cdt.utils.envvar.StorableEnvironment
Direct Known Subclasses:
PrefsStorableEnvironment

public class StorableEnvironment extends Object
This class represents the set of environment variables that could be loaded and stored in XML
Since:
3.0
  • Field Details Link icon

  • Constructor Details Link icon

    • StorableEnvironment Link icon

      public StorableEnvironment(IEnvironmentVariable[] variables, boolean isReadOnly)
      Parameters:
      variables -
      isReadOnly -
    • StorableEnvironment Link icon

      public StorableEnvironment(boolean isReadOnly)
      Create new empty StorableEnvironment
      Parameters:
      isReadOnly -
    • StorableEnvironment Link icon

      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's StorableEnvironmentLoader.ISerializeInfo isn't copied over, as it's expected this environment's settings will be stored elsewhere
      Parameters:
      env -
      isReadOnly -
    • StorableEnvironment Link icon

      public StorableEnvironment(ICStorageElement element, boolean isReadOnly)
      Initialize the StorableEnvironment from an ICStorageElement tree
      Parameters:
      element -
      isReadOnly -
  • Method Details Link icon

    • serialize Link icon

      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 Link icon

      public IEnvironmentVariable createVariable(String name, String value, int op, String delimiter)
    • createVariable Link icon

      public IEnvironmentVariable createVariable(String name)
    • createVariable Link icon

      public IEnvironmentVariable createVariable(String name, String value)
    • createVariable Link icon

      public IEnvironmentVariable createVariable(String name, String value, String delimiter)
    • checkVariable Link icon

      public IEnvironmentVariable checkVariable(String name, String value, int op, String delimiter)
    • isDirty Link icon

      public boolean isDirty()
      Returns the "dirty" state of the environment. If the dirty state is true, 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 to false when the environment is serialized by calling the serialize() method
      Returns:
      boolean
    • setDirty Link icon

      public void setDirty(boolean dirty)
      sets the "dirty" state of the environment
      Parameters:
      dirty - represents the new state
    • isChanged Link icon

      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 to false only by calling the setChanged(false) method
      Returns:
      boolean
    • setChanged Link icon

      public void setChanged(boolean changed)
      sets the "change" state of the environment
      Parameters:
      changed - represents the new "change" state
    • getVariable Link icon

      public IEnvironmentVariable getVariable(String name)
      Parameters:
      name -
      Returns:
      the environment variable with the given name, or null
    • setVariales Link icon

      public void setVariales(IEnvironmentVariable[] vars)
      Set the enviornment variables in this StorableEnvironment
      Parameters:
      vars -
    • createVriables Link icon

      public void createVriables(IEnvironmentVariable[] vars)
    • getVariables Link icon

      public IEnvironmentVariable[] getVariables()
    • deleteVariable Link icon

      public IEnvironmentVariable deleteVariable(String name)
    • deleteAll Link icon

      public boolean deleteAll()
    • isReadOnly Link icon

      public boolean isReadOnly()
    • appendEnvironment Link icon

      public boolean appendEnvironment()
    • setAppendEnvironment Link icon

      public void setAppendEnvironment(boolean append)
    • appendContributedEnvironment Link icon

      public boolean appendContributedEnvironment()
    • setAppendContributedEnvironment Link icon

      public void setAppendContributedEnvironment(boolean append)
    • restoreDefaults Link icon

      public void restoreDefaults()