java.lang.Object
is.codion.swing.common.ui.component.combobox.Completion

public final class Completion extends Object
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.

  • Field Details

  • Method Details

    • maximumMatch

      public static <C extends JComboBox<T>, T> C maximumMatch(C comboBox)
      Enables maximum match on the given combobox
      Type Parameters:
      C - the combobox type
      T - 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 type
      T - the type
      Parameters:
      comboBox - the combobox on which to enable maximum match
      normalize - if YES then accented characters are normalized before matching
      Returns:
      the combo box
    • autoComplete

      public static <C extends JComboBox<T>, T> C autoComplete(C comboBox)
      Enables auto-completion on the given combobox
      Type Parameters:
      C - the combobox type
      T - 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 type
      T - the type
      Parameters:
      comboBox - the combobox on which to enable autocompletion
      normalize - if YES then accented characters are normalized before matching
      Returns:
      the combo box
    • enable

      public static <C extends JComboBox<T>, T> C enable(C comboBox)
      Enables the default completion mode on the given combo box
      Type Parameters:
      C - the combo box type
      T - the value type
      Parameters:
      comboBox - the combo box
      Returns:
      the combo box
      See Also:
    • enable

      public static <C extends JComboBox<T>, T> C enable(C comboBox, Completion.Mode completionMode)
      Enables the given completion mode on the given combo box
      Type Parameters:
      C - the combo box type
      T - the value type
      Parameters:
      comboBox - the combo box
      completionMode - the mode to enable
      Returns:
      the combo box
      See Also: