Class AutoCompleteTextEditingSupport<T,V>
java.lang.Object
org.eclipse.jface.viewers.EditingSupport
com.amalgamasimulation.desktop.binding.editingsupports.GenericEditingSupport<T,V>
com.amalgamasimulation.desktop.binding.editingsupports.TextEditingSupport<T,V>
com.amalgamasimulation.desktop.binding.editingsupports.AutoCompleteTextEditingSupport<T,V>
- Type Parameters:
T- type of row valueV- type of column value (cell value)
- Direct Known Subclasses:
EMFAutoCompleteTextEditingSupport
Class is used to enable editing a table cell via a auto complete with a list of values.
After pressing CTRL-Space a combo box with a list of values appears
- Author:
- Ionov Ivan
-
Field Summary
Fields inherited from class com.amalgamasimulation.desktop.binding.editingsupports.TextEditingSupport
selectionListener, strategy, valueExtractorFields inherited from class com.amalgamasimulation.desktop.binding.editingsupports.GenericEditingSupport
canEditCell, parent, viewer -
Constructor Summary
ConstructorsConstructorDescriptionAutoCompleteTextEditingSupport(org.eclipse.jface.viewers.ColumnViewer viewer, org.eclipse.swt.widgets.Composite parent) -
Method Summary
Modifier and TypeMethodDescriptionenableNullElement(String notSetLiteral) Add an element on top of other elements in the combo box to clear the table cell value.protected org.eclipse.jface.viewers.CellEditorgetCellEditorInternal(T element) setComparator(Comparator<V> comparator) Add a comparator that is used to sort combo box values.setElements(org.eclipse.core.databinding.observable.list.IObservableList<V> elements) Set up the value elementssetFilter(BiPredicate<T, V> filter) Add a filter.setNameExtractor(Function<V, String> nameExtractor) Set up the combo box elements naming.protected voidsetValueInternal(T element, V value) Methods inherited from class com.amalgamasimulation.desktop.binding.editingsupports.TextEditingSupport
getValueInternal, setSelectionListener, setStrategy, setValueExtractorMethods inherited from class com.amalgamasimulation.desktop.binding.editingsupports.GenericEditingSupport
canEdit, canEditInternal, getCellEditor, getValue, initializeCellEditorValue, initializeCellEditorValueInternal, setCanEditCell, setValueMethods inherited from class org.eclipse.jface.viewers.EditingSupport
getViewer, saveCellEditorValue
-
Constructor Details
-
AutoCompleteTextEditingSupport
public AutoCompleteTextEditingSupport(org.eclipse.jface.viewers.ColumnViewer viewer, org.eclipse.swt.widgets.Composite parent)
-
-
Method Details
-
getCellEditorInternal
- Overrides:
getCellEditorInternalin classTextEditingSupport<T,V>
-
setValueInternal
- Overrides:
setValueInternalin classTextEditingSupport<T,V>
-
enableNullElement
Add an element on top of other elements in the combo box to clear the table cell value.- Parameters:
notSetLiteral- the label of the new combo box element that clears the cell value (typical values are: "", etc.) - Returns:
- this object
-
setFilter
Add a filter. Only matching items will be displayed in the combo box.
Note that there may be at most one filter. If you call this method several times, only the last method call will be effective.- Returns:
- this object
-
setComparator
Add a comparator that is used to sort combo box values.
Note that there may be at most one comparator. If you call this method several times, only the last method call will be effective.- Returns:
- this object
-
setNameExtractor
Set up the combo box elements naming. The name extractor.- Parameters:
nameExtractor- function that converts a combo box element to a String displayed in the combo box- Returns:
- this object
-
setElements
public AutoCompleteTextEditingSupport<T,V> setElements(org.eclipse.core.databinding.observable.list.IObservableList<V> elements) Set up the value elements- Parameters:
elements- List of elements to be shown in the auto complete- Returns:
- this object
-