Class Completion


  • public final class Completion
    extends Object
    Code originally from: http://www.orbital-computer.de/JComboBox Selects an item in a JComboBox based on values typed in on the keyboard.
    • Constructor Detail

      • Completion

        public Completion()
    • Method Detail

      • 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:
        COMBO_BOX_COMPLETION_MODE
      • 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:
        COMBO_BOX_COMPLETION_MODE