Module is.codion.swing.common.ui
Class Completion
java.lang.Object
is.codion.swing.common.ui.component.combobox.Completion
Selects an item in a JComboBox based on values typed on the keyboard.
Based on code originally from: http://www.orbital-computer.de/JComboBox
Included with permission.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
The available completion modes.static enum
Specifies whether to normalize accented characters in a String. -
Field Summary
Modifier and TypeFieldDescriptionstatic final PropertyValue<Completion.Mode>
Specifies the default completion model used for comboboxes. -
Method Summary
Modifier and TypeMethodDescriptionstatic <C extends JComboBox<T>,
T>
CautoComplete
(C comboBox) Enables auto-completion on the given comboboxstatic <C extends JComboBox<T>,
T>
CautoComplete
(C comboBox, Completion.Normalize normalize) Enables auto-completion on the given comboboxstatic <C extends JComboBox<T>,
T>
Cenable
(C comboBox) Enables the default completion mode on the given combo boxstatic <C extends JComboBox<T>,
T>
Cenable
(C comboBox, Completion.Mode completionMode) Enables the given completion mode on the given combo boxstatic <C extends JComboBox<T>,
T>
CmaximumMatch
(C comboBox) Enables maximum match on the given comboboxstatic <C extends JComboBox<T>,
T>
CmaximumMatch
(C comboBox, Completion.Normalize normalize) Enables maximum match on the given combobox
-
Field Details
-
COMBO_BOX_COMPLETION_MODE
Specifies the default completion model used for comboboxes.Completion.Mode.MAXIMUM_MATCH
for maximum match,Completion.Mode.AUTOCOMPLETE
for auto-completion orCompletion.Mode.NONE
for no completion.- Value type:String
- Default value:
Completion.Mode.MAXIMUM_MATCH
-
-
Method Details
-
maximumMatch
Enables maximum match on the given combobox- Type Parameters:
C
- the combobox typeT
- the type- Parameters:
comboBox
- the combobox on which to enable maximum match- Returns:
- the combo box
-
maximumMatch
public static <C extends JComboBox<T>,T> C maximumMatch(C comboBox, Completion.Normalize normalize) Enables maximum match on the given combobox- Type Parameters:
C
- the combobox typeT
- the type- Parameters:
comboBox
- the combobox on which to enable maximum matchnormalize
- if YES then accented characters are normalized before matching- Returns:
- the combo box
-
autoComplete
Enables auto-completion on the given combobox- Type Parameters:
C
- the combobox typeT
- the type- Parameters:
comboBox
- the combobox on which to enable autocompletion- Returns:
- the combo box
-
autoComplete
public static <C extends JComboBox<T>,T> C autoComplete(C comboBox, Completion.Normalize normalize) Enables auto-completion on the given combobox- Type Parameters:
C
- the combobox typeT
- the type- Parameters:
comboBox
- the combobox on which to enable autocompletionnormalize
- if YES then accented characters are normalized before matching- Returns:
- the combo box
-
enable
Enables the default completion mode on the given combo box- Type Parameters:
C
- the combo box typeT
- the value type- Parameters:
comboBox
- the combo box- Returns:
- the combo box
- See Also:
-
enable
Enables the given completion mode on the given combo box- Type Parameters:
C
- the combo box typeT
- the value type- Parameters:
comboBox
- the combo boxcompletionMode
- the mode to enable- Returns:
- the combo box
- See Also:
-