Class AbstractExpandableGUIVariable

    • Field Detail

    • Constructor Detail

      • AbstractExpandableGUIVariable

        protected AbstractExpandableGUIVariable​(IDecisionVariable variable,
                                                org.eclipse.swt.widgets.Composite parent,
                                                GUIConfiguration parentConfig,
                                                GUIVariable varParent)
        Sole constructor for this class.
        Parameters:
        variable - The IDecisionVariable represented by this GUIVariable
        parent - The controlling composite, needed for the creation of CellEditors
        parentConfig - The GUIConfiguration holding this GUIVariable
        varParent - The parent GUIVariable holding this variable. Can be null if and only if this variable is a top level variable stored inside the configuration.
    • Method Detail

      • createNestedVariables

        protected void createNestedVariables()
        Creates nested GUIVariables for this variable. This method should be called inside the constructor and if the number of nested variables has been changed, e.g. a nested sequence item has been added to this variable.
      • getCellEditor

        public final org.eclipse.jface.viewers.CellEditor getCellEditor​(org.eclipse.swt.widgets.Composite parent)
        Description copied from class: GUIVariable
        Returns a CellEditor for a table.
        Specified by:
        getCellEditor in class GUIVariable
        Parameters:
        parent - The GUI component where this GUIVariable and, thus, its editor are displayed.
        Returns:
        CellEditor to configure the enclosed IDecisionVariable
      • getEditor

        public GUIEditor getEditor()
        Description copied from class: GUIVariable
        Returns the (non-cell) editor for this variable. The editor shall be ready to use, i.e., properly initialized.
        Specified by:
        getEditor in class GUIVariable
        Returns:
        the editor, may be null if the variable shall not be displayed / being edited
      • setValue

        public void setValue​(java.lang.Object value)
        Description copied from class: GUIVariable
        Sets the value of the wrapped IDecisionVariable.
        Overrides:
        setValue in class GUIVariable
        Parameters:
        value - The value to be set.
      • getNestedElement

        public GUIVariable getNestedElement​(int index)
        Description copied from class: GUIVariable
        Returns a nested element specified by the given index.
        Overrides:
        getNestedElement in class GUIVariable
        Parameters:
        index - The 0-based index of the nested element.
        Returns:
        The specified nestedvariable.
      • isExpandable

        public final boolean isExpandable()
        Returns whether is variable can be expanded. Subclasses may override this method.
        Overrides:
        isExpandable in class GUIVariable
        Returns:
        true if this variable is expandable, otherwise false.
      • extend

        public GUIVariable extend()
        Description copied from class: GUIVariable
        Creates a new empty nested value/variable if supported. This method shall only be called by the set and sequence variables.
        Overrides:
        extend in class GUIVariable
        Returns:
        the new empty variable or null if nothing happened, e.g., not GUIVariable.isExtendable().
      • replace

        protected GUIVariable replace​(GUIVariable nestedVariable,
                                      Value value)
                               throws ConfigurationException
        Description copied from class: GUIVariable
        Replaces a variable to reflect the new value (of a more or less specific type).
        Overrides:
        replace in class GUIVariable
        Parameters:
        nestedVariable - the variable to be replaced (may affect top-level GUI variables)
        value - the new value carrying the type
        Returns:
        the new variable or nestedVariable
        Throws:
        ConfigurationException - in case that configuring the variable is not possible