Class GUIConfiguration

  • All Implemented Interfaces:
    IGUIConfigurableElement

    public class GUIConfiguration
    extends java.lang.Object
    implements IGUIConfigurableElement
    Wrapper class for this configuration as needed by the Eclipse GUI.
    Author:
    El-Sharkawy
    • Constructor Detail

      • GUIConfiguration

        public GUIConfiguration​(Configuration config,
                                org.eclipse.swt.widgets.Composite parent)
        Sole constructor for this class.
        Parameters:
        config - The origin configuration.
        parent - Should be a table for creating CellEditors
    • Method Detail

      • determineVisible

        private static void determineVisible​(IResolutionScope scope,
                                             java.util.Set<AbstractVariable> visible,
                                             java.util.Set<IResolutionScope> done)
        Determines the actually visible variables for the given resolution scope.
        Parameters:
        scope - the resolution scope (project or interface)
        visible - the visible variables (to be modified as a side effect)
        done - already processed scopes
      • initMap

        public void initMap()
        Resets the map and adds only all top level elements to this map.
      • replace

        public GUIVariable replace​(GUIVariable var,
                                   Value val)
                            throws ConfigurationException
        Replaces a variable to reflect the new value (of a more or less specific type).
        Parameters:
        var - the variable to be replaced (may affect top-level GUI variables)
        val - the new value carrying the type
        Returns:
        the new variable or var
        Throws:
        ConfigurationException - in case that configuring the variable is not possibe
      • getElements

        public GUIVariable[] getElements()
        Returns the GUI Elements which should be shown inside the GUI as an array.
        Returns:
        Not hidden configuration items.
      • changed

        void changed​(GUIVariable var)
        Informs all listeners that this model contains unsaved data.
        Parameters:
        var - The variable which has been changed inside the GUI.
      • configurationChanged

        public void configurationChanged()
        Informs all listeners that this model contains unsaved data.
      • getItemCount

        public int getItemCount()
        Returns the number of items.
        Returns:
        the number of items
      • setErrorMessages

        public void setErrorMessages​(Message[] warnings)
        Deletes all error messages for the GUIVariable's of this configuration and adds the given messages to variables affected variables.
        Parameters:
        warnings - A list of error/warning messages, produced by a reasoning step. warnings[i].getConflicts() must return a list containing only constraints.
      • clearErrorMessages

        public void clearErrorMessages()
        Removes the error messages of all stored GUIVariable. This method should be called after a reasoning was performed and no error was detected.
      • freeze

        public void freeze()
        Causes to freeze all values.
      • getConfig

        public Configuration getConfig()
        Returns the variability configuration.
        Returns:
        the variability configuration