Class InterfaceDropDown
- java.lang.Object
-
- net.ssehub.easy.producer.ui.productline_editor.components.AbstractComboBox<ProjectInterface>
-
- net.ssehub.easy.producer.ui.productline_editor.configuration.InterfaceDropDown
-
public class InterfaceDropDown extends AbstractComboBox<ProjectInterface>
Drop down menu for selecting project interfaces defined in this project, to use them as a filter.- Author:
- Sascha El-Sharkawy
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class net.ssehub.easy.producer.ui.productline_editor.components.AbstractComboBox
AbstractComboBox.ComboBoxListener<Value>
-
-
Field Summary
Fields Modifier and Type Field Description private ProjectlastProjectThe information, which was used to build the selectable data of this combo box.-
Fields inherited from class net.ssehub.easy.producer.ui.productline_editor.components.AbstractComboBox
NO_SELECTION_VALUE
-
-
Constructor Summary
Constructors Constructor Description InterfaceDropDown(PLPInfo plp, org.eclipse.swt.widgets.Composite parent, AbstractComboBox.ComboBoxListener<ProjectInterface> listener)Sole constructor for this class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.util.List<ProjectInterface>calculateValues()Part of the individual sub class: Calculates elements which may be selected by this combo box.protected booleanequals(ProjectInterface value1, ProjectInterface value2)Compare method to check whether the old selection is equal to one of the new elements calculated inside theAbstractComboBox.update()method, e.q.protected java.lang.StringgetDisplayName(ProjectInterface element)Returns a String representing a selectable element.protected voidonInit()Method if something additional should be at the end of the constructor call.voidupdate()Updates its information.-
Methods inherited from class net.ssehub.easy.producer.ui.productline_editor.components.AbstractComboBox
addListener, getProductLineProject, getProject, getSelectedValue, select, size
-
-
-
-
Field Detail
-
lastProject
private Project lastProject
The information, which was used to build the selectable data of this combo box.
Attention: This value will initialized by theupdate()call of the constructor ofAbstractComboBox.
-
-
Constructor Detail
-
InterfaceDropDown
public InterfaceDropDown(PLPInfo plp, org.eclipse.swt.widgets.Composite parent, AbstractComboBox.ComboBoxListener<ProjectInterface> listener)
Sole constructor for this class.- Parameters:
plp- ThePLPInfowhich will be configured by this combo box, will also be used for creating the displayed information.parent- The parent container holding this combo boxlistener- Listeners which should already be informed while this combo box is created.
-
-
Method Detail
-
calculateValues
protected java.util.List<ProjectInterface> calculateValues()
Description copied from class:AbstractComboBoxPart of the individual sub class: Calculates elements which may be selected by this combo box.- Specified by:
calculateValuesin classAbstractComboBox<ProjectInterface>- Returns:
- A list of items which may be selected by this combo box, must not be null.
-
getDisplayName
protected java.lang.String getDisplayName(ProjectInterface element)
Description copied from class:AbstractComboBoxReturns a String representing a selectable element.- Specified by:
getDisplayNamein classAbstractComboBox<ProjectInterface>- Parameters:
element- a selectable element of this combo box.- Returns:
- A name which is sufficient for the user.
-
onInit
protected void onInit()
Description copied from class:AbstractComboBoxMethod if something additional should be at the end of the constructor call.- Overrides:
onInitin classAbstractComboBox<ProjectInterface>
-
equals
protected boolean equals(ProjectInterface value1, ProjectInterface value2)
Description copied from class:AbstractComboBoxCompare method to check whether the old selection is equal to one of the new elements calculated inside theAbstractComboBox.update()method, e.q. return value1.equals(value2).
Sometimes the exiting equals method are not sufficient for this combo box.- Specified by:
equalsin classAbstractComboBox<ProjectInterface>- Parameters:
value1- On value to compare with the other, maybe null.value2- On value to compare with the other, maybe null.- Returns:
- true if value1 and value2 are equal in the context of this combo box.
-
update
public void update()
Description copied from class:AbstractComboBoxUpdates its information.
Recalculates the data displayed (and selectable) by this combo box.- Overrides:
updatein classAbstractComboBox<ProjectInterface>
-
-