Class AbstractAutoCompleteTextDataBinding<V>
java.lang.Object
com.amalgamasimulation.desktop.binding.widgets.AbstractTextDataBinding<V>
com.amalgamasimulation.desktop.binding.widgets.AbstractAutoCompleteTextDataBinding<V>
- Type Parameters:
V- The type of selectable values
- All Implemented Interfaces:
AbstractDataBinding<V>,AbstractSelectObjectDataBinding<V>
- Direct Known Subclasses:
AutoCompleteTextDataBinding,ContainerAutoCompleteTextDataBinding
public abstract class AbstractAutoCompleteTextDataBinding<V>
extends AbstractTextDataBinding<V>
implements AbstractSelectObjectDataBinding<V>
Abstract base class for auto-complete text field bindings with support for filtering,
sorting, and validation of selectable values. Combines text input with dropdown
suggestions from a predefined list of values.
Key features include:
- Auto-complete functionality with configurable matching method
- Value filtering and sorting capabilities
- Built-in validation against allowed values
- Customizable value formatting for display
- Author:
- Ionov Ivan
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Comparator<V> Comparator for sorting auto-complete suggestions.Filter predicate for limiting available values in auto-complete suggestions.The list of available values for auto-completion.Fields inherited from class com.amalgamasimulation.desktop.binding.widgets.AbstractTextDataBinding
background, canBeNull, controlDecoration, readonly, strategy, text -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidCreates and initializes the data binding.protected abstract StringFormats a value for display in the auto-complete dropdown.voidsetComparator(Comparator<V> comparator) Sets a comparator to define the sorting order of values.voidSets a filter predicate to determine which values should be included.voidSets the complete list of available values for selection.Methods inherited from class com.amalgamasimulation.desktop.binding.widgets.AbstractTextDataBinding
background, canBeNull, enable, executeToModel, executeToTarget, isSenseless, readonly, setControl, strategyMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.amalgamasimulation.desktop.binding.widgets.AbstractDataBinding
createControlDecoration, doAction, enable, executeToModel, executeToTarget, getValue, setControl
-
Field Details
-
filter
Filter predicate for limiting available values in auto-complete suggestions. Defaults to accepting all values (always returns true). -
comparator
Comparator for sorting auto-complete suggestions. Defaults to no sorting (always returns 0). -
values
The list of available values for auto-completion. Defaults to an empty list.
-
-
Constructor Details
-
AbstractAutoCompleteTextDataBinding
public AbstractAutoCompleteTextDataBinding()
-
-
Method Details
-
format
Formats a value for display in the auto-complete dropdown. Must be implemented by concrete subclasses.- Parameters:
value- The value to format- Returns:
- String representation of the value
-
createBinding
public void createBinding()Description copied from interface:AbstractDataBindingCreates and initializes the data binding.- Specified by:
createBindingin interfaceAbstractDataBinding<V>- Overrides:
createBindingin classAbstractTextDataBinding<V>
-
setFilter
Description copied from interface:AbstractSelectObjectDataBindingSets a filter predicate to determine which values should be included.- Specified by:
setFilterin interfaceAbstractSelectObjectDataBinding<V>- Parameters:
filter- Predicate that returns true for values to include
-
setComparator
Description copied from interface:AbstractSelectObjectDataBindingSets a comparator to define the sorting order of values.- Specified by:
setComparatorin interfaceAbstractSelectObjectDataBinding<V>- Parameters:
comparator- Comparator to use for sorting values
-
values
Description copied from interface:AbstractSelectObjectDataBindingSets the complete list of available values for selection.- Specified by:
valuesin interfaceAbstractSelectObjectDataBinding<V>- Parameters:
values- List of all possible values
-