Class GUIValueFactory
- java.lang.Object
-
- net.ssehub.easy.producer.ui.confModel.GUIValueFactory
-
public class GUIValueFactory extends java.lang.ObjectCreates aGUIVariablefor a givenIDecisionVariable.- Author:
- El-Sharkawy
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classGUIValueFactory.VariableVisitorPart of theGUIValueFactoryfor creating aGUIVariable.
-
Field Summary
Fields Modifier and Type Field Description private static booleancreateUpdatableCellEditors
-
Constructor Summary
Constructors Constructor Description GUIValueFactory()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static ComboboxGUIVariable.ComboItem[]createComboItemArray(IDecisionVariable variable, int length)Creates the array for combobox items and pre-assigns the null value if required viaDisplayNameProvider.enableNullValueInConfiguration(IDecisionVariable).static ComboboxGUIVariable.ComboItem[]createComboItems(IDecisionVariable variable, Reference reference)Creates combo items for the givenvariableof typereference.static booleancreateUpdatableCellEditors()Returns whether updatable cell editors shall be created if possible.static voidcreateUpdatableCellEditors(boolean updatable)Defines whether updatable cell editors shall be created if possible.static GUIVariablecreateVariable(IDecisionVariable variable, org.eclipse.swt.widgets.Composite parent, GUIConfiguration config, GUIVariable varParent)Creates a newGUIVariable.static GUIVariablecreateVariable(IDecisionVariable variable, org.eclipse.swt.widgets.Composite parent, GUIConfiguration config, GUIVariable varParent, java.util.List<IRangeRestriction> rangeRestrictors)Creates a newGUIVariable.private static <T> java.util.List<T>makeUnique(java.util.List<T> list)Returns a list of unique elements taken fromlist.
-
-
-
Method Detail
-
createVariable
public static GUIVariable createVariable(IDecisionVariable variable, org.eclipse.swt.widgets.Composite parent, GUIConfiguration config, GUIVariable varParent)
Creates a newGUIVariable.- Parameters:
variable- TheIDecisionVariablerepresented by this GUIVariableparent- The controlling composite, needed for the creation of CellEditorsconfig- TheGUIConfigurationholding this BasisGUIVariablevarParent- The parent GUIVariable holding this variable. Can be null if and only if this variable is a top level variable stored inside the configuration.- Returns:
- A GUI representation of the
IDecisionVariable
-
createVariable
public static GUIVariable createVariable(IDecisionVariable variable, org.eclipse.swt.widgets.Composite parent, GUIConfiguration config, GUIVariable varParent, java.util.List<IRangeRestriction> rangeRestrictors)
Creates a newGUIVariable.- Parameters:
variable- TheIDecisionVariablerepresented by this GUIVariableparent- The controlling composite, needed for the creation of CellEditorsconfig- TheGUIConfigurationholding this BasisGUIVariablevarParent- The parent GUIVariable holding this variable. Can be null if and only if this variable is a top level variable stored inside the configuration.rangeRestrictors- Optional list to restrict values of someGUIVariable, e.g., to restrict values of combo box based variables.- Returns:
- A GUI representation of the
IDecisionVariable
-
createComboItemArray
private static ComboboxGUIVariable.ComboItem[] createComboItemArray(IDecisionVariable variable, int length)
Creates the array for combobox items and pre-assigns the null value if required viaDisplayNameProvider.enableNullValueInConfiguration(IDecisionVariable). The caller may utilize the result untillengthbut not further.- Parameters:
variable- the variable to create the combo items forlength- the length of the array to be created (except for null value entries)- Returns:
- the created array
-
makeUnique
private static <T> java.util.List<T> makeUnique(java.util.List<T> list)
Returns a list of unique elements taken fromlist.- Type Parameters:
T- the element type- Parameters:
list- the list to be processed- Returns:
- the list of unique elements from
listin sequence oflist
-
createComboItems
public static ComboboxGUIVariable.ComboItem[] createComboItems(IDecisionVariable variable, Reference reference)
Creates combo items for the givenvariableof typereference.- Parameters:
variable- the variable to be consideredreference- the (required) reference type ofvariable- Returns:
- the combo items
-
createUpdatableCellEditors
public static final void createUpdatableCellEditors(boolean updatable)
Defines whether updatable cell editors shall be created if possible.- Parameters:
updatable- iftrue, updatable cell editors shall be created,falsefor usual ones
-
createUpdatableCellEditors
public static final boolean createUpdatableCellEditors()
Returns whether updatable cell editors shall be created if possible.- Returns:
trueif updatable cell editors shall be created,falsefor usual ones
-
-