Class SeparatorSuggestionGenerator<T>
java.lang.Object
org.tentackle.fx.component.auto.AbstractSuggestionGenerator<T>
org.tentackle.fx.component.auto.AbstractSegmentedSuggestionGenerator<T>
org.tentackle.fx.component.auto.SeparatorSuggestionGenerator<T>
- Type Parameters:
T- the type of the available choices
suggestion generator function for strings composed of separated strings.
Useful for number matching in choices like
Useful for number matching in choices like
XXX-YYY-Z-AAA.-
Constructor Summary
ConstructorsConstructorDescriptionSeparatorSuggestionGenerator(String separator) Creates an suggestion generator for a given separator. -
Method Summary
Modifier and TypeMethodDescriptionextractSegments(String text) Extracts the separated segments from a string.booleanReturns whether comparison is case-sensitive.protected SubStringDetermines the matching segment between an input- and item-segment.voidsetCaseSensitive(boolean caseSensitive) Sets case sensitivity.Methods inherited from class AbstractSegmentedSuggestionGenerator
apply, extractInputSegments, extractItemSegments, getItemSegments, getMaxSuggestions, setMaxSuggestions, setSelectListMethods inherited from class AbstractSuggestionGenerator
convert, createSubString, getChoices, getSelectList, setChoices
-
Constructor Details
-
SeparatorSuggestionGenerator
Creates an suggestion generator for a given separator.- Parameters:
separator- the separator string
-
-
Method Details
-
isCaseSensitive
public boolean isCaseSensitive()Returns whether comparison is case-sensitive.- Returns:
- true if case-sensitive, false if not (default)
-
setCaseSensitive
public void setCaseSensitive(boolean caseSensitive) Sets case sensitivity.- Parameters:
caseSensitive- true if case-sensitive, false if not (default)
-
match
Description copied from class:AbstractSegmentedSuggestionGeneratorDetermines the matching segment between an input- and item-segment.- Specified by:
matchin classAbstractSegmentedSuggestionGenerator<T>- Parameters:
inputSegment- the input segmentitemSegment- the item segment- Returns:
- the matching segment, null if none
-
extractSegments
Extracts the separated segments from a string.- Specified by:
extractSegmentsin classAbstractSegmentedSuggestionGenerator<T>- Parameters:
text- the string- Returns:
- the segments
-