Interface ComboBoxBuilder<T,C extends JComboBox<T>,B extends ComboBoxBuilder<T,C,B>>

Type Parameters:
T - the value type
C - the component type
B - the builder type
All Superinterfaces:
ComponentBuilder<T,C,B>
All Known Subinterfaces:
EntityComboBox.Builder
All Known Implementing Classes:
DefaultComboBoxBuilder

public interface ComboBoxBuilder<T,C extends JComboBox<T>,B extends ComboBoxBuilder<T,C,B>> extends ComponentBuilder<T,C,B>
Builds a JComboBox.
  • Method Details

    • editable

      B editable(boolean editable)
      Parameters:
      editable - specifies whether the combo box should be editable
      Returns:
      this builder instance
      See Also:
    • completionMode

      B completionMode(Completion.Mode completionMode)
      Parameters:
      completionMode - the completion mode
      Returns:
      this builder instance
    • renderer

      B renderer(ListCellRenderer<T> renderer)
      Parameters:
      renderer - the renderer for the combo box
      Returns:
      this builder instance
      See Also:
    • editor

      B editor(ComboBoxEditor editor)
      Parameters:
      editor - the editor for the combo box
      Returns:
      this builder instance
      See Also:
    • mouseWheelScrolling

      B mouseWheelScrolling(boolean mouseWheelScrolling)
      Enable mouse wheel scrolling on the combo box
      Parameters:
      mouseWheelScrolling - true if mouse wheel scrolling should be enabled
      Returns:
      this builder instance
    • mouseWheelScrollingWithWrapAround

      B mouseWheelScrollingWithWrapAround(boolean mouseWheelScrollingWithWrapAround)
      Enable mouse wheel scrolling on the combo box, with wrap around
      Parameters:
      mouseWheelScrollingWithWrapAround - true if mouse wheel scrolling with wrap around should be enabled
      Returns:
      this builder instance
    • maximumRowCount

      B maximumRowCount(int maximumRowCount)
      Parameters:
      maximumRowCount - the maximum row count before a scroll bar is shown
      Returns:
      this builder instance
      See Also:
    • moveCaretToFrontOnSelection

      B moveCaretToFrontOnSelection(boolean moveCaretToFrontOnSelection)
      When a JComboBox is editable, and a long item is selected, the caret is moved to the end, hiding the start of the selected item. Enabling this moves the caret to the front on selection, thereby showing the start of the selected item. Note that this only works in conjunction with a FilterComboBoxModel. This is enabled by default.
      Parameters:
      moveCaretToFrontOnSelection - if true the caret is moved to the front of the editor component on selection, displaying the start of the selected item, instead of the end
      Returns:
      this builder instance
    • popupWidth

      B popupWidth(int popupWidth)
      Only applicable for the system and cross-platform Look and Feels.
      Parameters:
      popupWidth - a fixed popup width
      Returns:
      this builder instance
    • itemListener

      B itemListener(ItemListener itemListener)
      Parameters:
      itemListener - the item listener
      Returns:
      this builder instance
      See Also:
    • builder

      static <T, C extends JComboBox<T>, B extends ComboBoxBuilder<T, C, B>> ComboBoxBuilder<T,C,B> builder(ComboBoxModel<T> comboBoxModel)
      Type Parameters:
      T - the value type
      C - the component type
      B - the builder type
      Parameters:
      comboBoxModel - the combo box model
      Returns:
      a builder for a component
    • builder

      static <T, C extends JComboBox<T>, B extends ComboBoxBuilder<T, C, B>> ComboBoxBuilder<T,C,B> builder(ComboBoxModel<T> comboBoxModel, Value<T> linkedValue)
      Type Parameters:
      T - the value type
      C - the component type
      B - the builder type
      Parameters:
      comboBoxModel - the combo box model
      linkedValue - the value to link to the component
      Returns:
      a builder for a component
    • enableMouseWheelSelection

      static void enableMouseWheelSelection(JComboBox<?> comboBox)
      Enables mouse wheel selection for the given combo box
      Parameters:
      comboBox - the combo box
    • enableMouseWheelSelectionWithWrapAround

      static void enableMouseWheelSelectionWithWrapAround(JComboBox<?> comboBox)
      Enables mouse wheel selection for the given combo box with wrap around
      Parameters:
      comboBox - the combo box