Class BasisGUIVariable
- java.lang.Object
-
- net.ssehub.easy.producer.ui.confModel.GUIVariable
-
- net.ssehub.easy.producer.ui.confModel.BasisGUIVariable
-
- All Implemented Interfaces:
java.lang.Comparable<GUIVariable>,IGUIConfigurableElement
class BasisGUIVariable extends GUIVariable
GUI representation ofIDecisionVariables which can be configured with a simple text editor.- Author:
- El-Sharkawy
-
-
Constructor Summary
Constructors Constructor Description BasisGUIVariable(IDecisionVariable variable, org.eclipse.swt.widgets.Composite parent, GUIConfiguration config, GUIVariable varParent)Sole constructor for this class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.eclipse.jface.viewers.CellEditorgetCellEditor(org.eclipse.swt.widgets.Composite parent)Returns aCellEditorfor a table.GUIEditorgetEditor()Returns the (non-cell) editor for this variable.java.lang.ObjectgetValue()Returns the value of the givenIDecisionVariableso that it can be used as return value for theEditingSupport.getValue(Object)method.protected ValuegetValueAssignment(java.lang.Object value)Converts the given object into aValue.java.lang.StringgetValueText()Returns a string representation of the current value.-
Methods inherited from class net.ssehub.easy.producer.ui.confModel.GUIVariable
addErrorMessage, compareTo, extend, freeze, getAssignmentState, getComment, getComposite, getConfiguration, getErrorMessages, getHistory, getName, getNestedDepth, getNestedElement, getNestedElementsCount, getNullLabel, getParent, getTooltip, getTopLevelParent, getType, getVariable, hasErrors, hasNullValue, hasValue, isAnnotated, isEditable, isExpandable, isExtendable, isFreezable, isFrozen, isTopLevelDeclaration, remove, removeErrorMessages, replace, replaceValue, setEmptyValue, setNULLValue, setValue, setVariable, toString, unfreeze
-
-
-
-
Constructor Detail
-
BasisGUIVariable
BasisGUIVariable(IDecisionVariable variable, org.eclipse.swt.widgets.Composite parent, GUIConfiguration config, GUIVariable varParent)
Sole constructor for this class.- 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.
-
-
Method Detail
-
getCellEditor
public org.eclipse.jface.viewers.CellEditor getCellEditor(org.eclipse.swt.widgets.Composite parent)
Description copied from class:GUIVariableReturns aCellEditorfor a table.- Specified by:
getCellEditorin classGUIVariable- Parameters:
parent- The GUI component where thisGUIVariableand, thus, its editor are displayed.- Returns:
CellEditorto configure the enclosedIDecisionVariable
-
getEditor
public GUIEditor getEditor()
Description copied from class:GUIVariableReturns the (non-cell) editor for this variable. The editor shall be ready to use, i.e., properly initialized.- Specified by:
getEditorin classGUIVariable- Returns:
- the editor, may be null if the variable shall not be displayed / being edited
-
getValueText
public java.lang.String getValueText()
Description copied from class:GUIVariableReturns a string representation of the current value. This is used when no cursor is inside the cell (if the user is not editing the variable).- Specified by:
getValueTextin classGUIVariable- Returns:
- A string representation of the current value or null.
-
getValueAssignment
protected Value getValueAssignment(java.lang.Object value) throws ValueDoesNotMatchTypeException
Description copied from class:GUIVariableConverts the given object into aValue.- Specified by:
getValueAssignmentin classGUIVariable- Parameters:
value- An object given by the Eclipse GUI.- Returns:
- A
Valuerepresentation of the object, maybe null. - Throws:
ValueDoesNotMatchTypeException- in case ofvaluecannot be converted to the related data type of the wrappedIDecisionVariable.
-
getValue
public java.lang.Object getValue()
Description copied from class:GUIVariableReturns the value of the givenIDecisionVariableso that it can be used as return value for theEditingSupport.getValue(Object)method.- Specified by:
getValuein classGUIVariable- Returns:
- A value as needed by the Eclipse UI.
-
-