Interface FilterComboBoxModel.Builder<T>

Type Parameters:
T - the item type
Enclosing interface:
FilterComboBoxModel<T>

public static interface FilterComboBoxModel.Builder<T>
  • Method Details

    • comparator

      Parameters:
      comparator - the comparator, null for unsorted
      Returns:
      this builder
    • includeNull

      FilterComboBoxModel.Builder<T> includeNull(boolean includeNull)
      Parameters:
      includeNull - true if a null item should be included
      Returns:
      this builder
    • nullItem

      Sets includeNull(boolean) to true if nullItem is non-null, false otherwise.
      Parameters:
      nullItem - the item representing null
      Returns:
      this builder
    • select

      Parameters:
      item - the item to select initially
      Returns:
      this builder
    • translator

      FilterComboBoxModel.Builder<T> translator(Function<Object,T> translator)
      Provides a way for a combo box model to translate an item received via SingleSelection.item() to an actual item to select, such as selecting the String "1" in a String based model when selected item is set to the Integer 1.
      Parameters:
      translator - the selected item translator
      Returns:
      this builder
    • filterSelected

      FilterComboBoxModel.Builder<T> filterSelected(boolean filterSelected)

      Specifies whether filtering the model affects the currently selected item. If true, the selection is cleared when the selected item is excluded from the model, otherwise the selected item can potentially represent a value which is not currently included in the model

      This is false by default.

      Parameters:
      filterSelected - true if the select item should be filtered
      See Also:
    • onSelection

      FilterComboBoxModel.Builder<T> onSelection(Consumer<@Nullable T> onSelection)
      Parameters:
      onSelection - called when an item is selected, note that this item may be null
      Returns:
      this builder instance
    • async

      FilterComboBoxModel.Builder<T> async(boolean async)
      Parameters:
      async - true if async refresh should be enabled
      Returns:
      this builder instance
    • onRefreshException

      FilterComboBoxModel.Builder<T> onRefreshException(Consumer<Exception> onRefreshException)
      By default, exceptions during refresh are rethrown, use this method to handle async exceptions differently
      Parameters:
      onRefreshException - the exception handler to use during refresh
      Returns:
      this builder instance
    • refresh

      FilterComboBoxModel.Builder<T> refresh(boolean refresh)
      Default false.
      Parameters:
      refresh - true if the model items should be refreshed on initialization
      Returns:
      this builder instance
    • build

      Returns:
      a new FilterComboBoxModel instance