Class AutoCompleteTextEditingSupport.Builder<T,E,R extends IEditableColumn<T,E,R>>
java.lang.Object
com.amalgamasimulation.desktop.ui.builders.AutoCompleteTextEditingSupport.Builder<T,E,R>
- Type Parameters:
T- type of row valueE- type of column value (cell value)R- column type
- All Implemented Interfaces:
AutoCompleteTextEditingSupport.ButtonListenerBuilder<T,,E, R> AutoCompleteTextEditingSupport.ElementsBuilder<T,,E, R> AutoCompleteTextEditingSupport.FinalBuilder<T,,E, R> AutoCompleteTextEditingSupport.NameBuilder<T,E, R>
- Enclosing class:
AutoCompleteTextEditingSupport
public static class AutoCompleteTextEditingSupport.Builder<T,E,R extends IEditableColumn<T,E,R>>
extends Object
implements AutoCompleteTextEditingSupport.ElementsBuilder<T,E,R>, AutoCompleteTextEditingSupport.NameBuilder<T,E,R>, AutoCompleteTextEditingSupport.FinalBuilder<T,E,R>, AutoCompleteTextEditingSupport.ButtonListenerBuilder<T,E,R>
A builder class to set up the properties of an auto-complete text editing support.
Instances of this class are created by
EditableColumn objects.
The build() method is used to actually set the properties to the column.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()This is the finalization method.Set function that returns a value that indicates whether the cell can be editedcomparator(Comparator<E> comparator) Add a comparator that is used to sort combobox values.static <T1,E1, R1 extends IEditableColumn<T1, E1, R1>>
AutoCompleteTextEditingSupport.ElementsBuilder<T1, E1, R1> create(R1 columnDescriptor) Set the elements to be shown in the comboboxenableNullElement(String notSetLiteral) Add an element on top of other elements in the combobox to clear the table cell value.filter(BiPredicate<T, E> filter) Add a filter.Add a filter.Set up the combobox elements naming.handler(BiConsumer<T, E> listener) Set function that will be executed after losing focus on the combo box editor or after pressing the Enter buttonstrategy(ValidationStrategy<E, String> strategy) Set a strategy that firstly validates the entered value before placing it in the object, and secondly processes the value from the object before displaying it in the editor.
-
Field Details
-
columnDescriptor
-
editingSupport
-
-
Constructor Details
-
Builder
-
-
Method Details
-
create
public static <T1,E1, AutoCompleteTextEditingSupport.ElementsBuilder<T1,R1 extends IEditableColumn<T1, E1, R1>> E1, createR1> (R1 columnDescriptor) -
elements
public AutoCompleteTextEditingSupport.NameBuilder<T,E, elementsR> (org.eclipse.core.databinding.observable.list.IObservableList<E> elements) Description copied from interface:AutoCompleteTextEditingSupport.ElementsBuilderSet the elements to be shown in the combobox- Specified by:
elementsin interfaceAutoCompleteTextEditingSupport.ElementsBuilder<T,E, R extends IEditableColumn<T, E, R>> - Parameters:
elements- list of elements- Returns:
- builder object
-
format
public AutoCompleteTextEditingSupport.ButtonListenerBuilder<T,E, formatR> (Function<E, String> nameExtractor) Description copied from interface:AutoCompleteTextEditingSupport.NameBuilderSet up the combobox elements naming. The name extractor.- Specified by:
formatin interfaceAutoCompleteTextEditingSupport.NameBuilder<T,E, R extends IEditableColumn<T, E, R>> - Parameters:
nameExtractor- function that converts a combobox element to a String displayed in the combobox- Returns:
- builder object
-
handler
Description copied from interface:AutoCompleteTextEditingSupport.ButtonListenerBuilderSet function that will be executed after losing focus on the combo box editor or after pressing the Enter button- Specified by:
handlerin interfaceAutoCompleteTextEditingSupport.ButtonListenerBuilder<T,E, R extends IEditableColumn<T, E, R>> - Parameters:
listener-- Returns:
- builder object
-
strategy
public AutoCompleteTextEditingSupport.FinalBuilder<T,E, strategyR> (ValidationStrategy<E, String> strategy) Description copied from interface:AutoCompleteTextEditingSupport.FinalBuilderSet a strategy that firstly validates the entered value before placing it in the object, and secondly processes the value from the object before displaying it in the editor. The default strategy checks the input value against the value extract from the elements using the nameExtractor.- Specified by:
strategyin interfaceAutoCompleteTextEditingSupport.FinalBuilder<T,E, R extends IEditableColumn<T, E, R>> - Parameters:
strategy-- Returns:
- builder object
-
enableNullElement
Description copied from interface:AutoCompleteTextEditingSupport.FinalBuilderAdd an element on top of other elements in the combobox to clear the table cell value.- Specified by:
enableNullElementin interfaceAutoCompleteTextEditingSupport.FinalBuilder<T,E, R extends IEditableColumn<T, E, R>> - Parameters:
notSetLiteral- the label of the new combobox element that clears the cell value (typical values are: "", etc.) - Returns:
- the builder object
-
filter
Description copied from interface:AutoCompleteTextEditingSupport.FinalBuilderAdd a filter. Only matching items will be displayed in the combobox.
Note that there may be at most one filter. If you call this method several times, only the last method call will be effective.- Specified by:
filterin interfaceAutoCompleteTextEditingSupport.FinalBuilder<T,E, R extends IEditableColumn<T, E, R>>
-
filter
Description copied from interface:AutoCompleteTextEditingSupport.FinalBuilderAdd a filter. Only matching items will be displayed in the combobox.
Note that there may be at most one filter. If you call this method several times, only the last method call will be effective.- Specified by:
filterin interfaceAutoCompleteTextEditingSupport.FinalBuilder<T,E, R extends IEditableColumn<T, E, R>>
-
comparator
Description copied from interface:AutoCompleteTextEditingSupport.FinalBuilderAdd a comparator that is used to sort combobox 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.- Specified by:
comparatorin interfaceAutoCompleteTextEditingSupport.FinalBuilder<T,E, R extends IEditableColumn<T, E, R>>
-
canEdit
Description copied from interface:AutoCompleteTextEditingSupport.FinalBuilderSet function that returns a value that indicates whether the cell can be edited- Specified by:
canEditin interfaceAutoCompleteTextEditingSupport.FinalBuilder<T,E, R extends IEditableColumn<T, E, R>> - Parameters:
canEdit-- Returns:
- builder object
-
build
Description copied from interface:AutoCompleteTextEditingSupport.FinalBuilderThis is the finalization method. Call this method to install the auto-complete combobox editing support on a table column.- Specified by:
buildin interfaceAutoCompleteTextEditingSupport.FinalBuilder<T,E, R extends IEditableColumn<T, E, R>>
-