Class AttributeValuesPage.TemporaryAttributesConfiguration

    • Constructor Detail

      • TemporaryAttributesConfiguration

        public TemporaryAttributesConfiguration​(Project project,
                                                AttributeValues values,
                                                boolean group)
        Creates a new configuration for the given project.
        Please take a look in VarModel#addProject(Project) for more information.
        Parameters:
        project - The project, where this configuration belongs to. This project should already be registered at the VarModel
        values - the attributes with values
        group - group the attributes
    • Method Detail

      • convert

        private boolean convert​(boolean group,
                                boolean force)
        Converts values to a group or non-group attribute values configuration. Converting to a grouped configuration may imply data loss.
        Parameters:
        group - convert to a group or non-group configuration
        force - the execution (initial call)
        Returns:
        true if the conversion was done, false else
      • addAttribute

        private void addAttribute​(Attribute attribute)
        Adds the given attribute and its values to this configuration.
        Parameters:
        attribute - the attribute to add
      • convert

        public boolean convert​(boolean group)
        Converts values to a group or non-group attribute values configuration. Converting to a grouped configuration may imply data loss.
        Parameters:
        group - convert to a group or non-group configuration
        Returns:
        true if the conversion was done, false else
      • sameGroup

        private boolean sameGroup​(Attribute attr1,
                                  Attribute attr2)
        Returns whether two given attributes are in the same group, i.e. same (non-qualified) name and same type.
        Parameters:
        attr1 - the first attribute
        attr2 - the same attribute
        Returns:
        true if attr1 and attr2 are in the same group, false else
      • addAttributeDecision

        public void addAttributeDecision​(Attribute attribute,
                                         Value value)
                                  throws ConfigurationException
        Adds an attribute decision to this configuration. This method is a specific functionality for user interaction. Subclass this class and make it accessible if needed, otherwise it may break the value protection provided by this class.
        Parameters:
        attribute - the attribute for which the decision shall be created
        value - the value of the attribute (may be null)
        Throws:
        ConfigurationException - in case of type conflicts
      • clear

        public void clear()
        Clears all decisions.
        Overrides:
        clear in class Configuration
      • removeDecision

        public boolean removeDecision​(IDecisionVariable variable)
        Remove a specific decision.
        Overrides:
        removeDecision in class Configuration
        Parameters:
        variable - the decision to be removed
        Returns:
        true if this operation was successful, false else
      • refreshed

        public void refreshed​(Configuration config)
        In case that the configuration was refreshed.
        Parameters:
        config - the new configuration
      • valueChanged

        public void valueChanged​(IDecisionVariable changedVariable,
                                 Value oldValue)
        To be called when a value changed.
        Parameters:
        changedVariable - the changed variable carrying the new value
        oldValue - the old value