Class 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
    • 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's StorableEnvironmentLoader.ISerializeInfo isn'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 -
      • isDirty

        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

        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 to false only 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​(String name)
        Parameters:
        name -
        Returns:
        the environment variable with the given name, or null
      • 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()