Class ItemComboBoxModel<T>

    • Method Detail

      • indexOf

        public int indexOf​(T value)
        Returns the index of the Item representing the given value, -1 if this model does not contain such an Item.
        Parameters:
        value - the value
        Returns:
        the index of the Item representing the given value, -1 if not found
      • createModel

        public static <T> ItemComboBoxModel<T> createModel()
        Type Parameters:
        T - the Item value type
        Returns:
        a new combo box model
      • createModel

        public static <T> ItemComboBoxModel<T> createModel​(List<Item<T>> items)
        Type Parameters:
        T - the Item value type
        Parameters:
        items - the items
        Returns:
        a new combo box model
      • createSortedModel

        public static <T> ItemComboBoxModel<T> createSortedModel()
        Type Parameters:
        T - the Item value type
        Returns:
        a new combo box model
      • createSortedModel

        public static <T> ItemComboBoxModel<T> createSortedModel​(List<Item<T>> items)
        Type Parameters:
        T - the Item value type
        Parameters:
        items - the items
        Returns:
        a new combo box model
      • createSortedModel

        public static <T> ItemComboBoxModel<T> createSortedModel​(Comparator<Item<T>> sortComparator)
        Type Parameters:
        T - the Item value type
        Parameters:
        sortComparator - the sort comparator to use
        Returns:
        a new combo box model
      • createSortedModel

        public static <T> ItemComboBoxModel<T> createSortedModel​(List<Item<T>> items,
                                                                 Comparator<Item<T>> sortComparator)
        Type Parameters:
        T - the Item value type
        Parameters:
        items - the items
        sortComparator - the sort comparator to use
        Returns:
        a new combo box model
      • createBooleanModel

        public static ItemComboBoxModel<Boolean> createBooleanModel()
        Constructs a new Boolean based ItemComboBoxModel with null as the initially selected value.
        Returns:
        a Boolean based ItemComboBoxModel
      • createBooleanModel

        public static ItemComboBoxModel<Boolean> createBooleanModel​(String nullCaption)
        Constructs a new Boolean based ItemComboBoxModel with null as the initially selected value.
        Parameters:
        nullCaption - the string representing a null value
        Returns:
        a Boolean based ItemComboBoxModel
      • createBooleanModel

        public static ItemComboBoxModel<Boolean> createBooleanModel​(String nullCaption,
                                                                    String trueCaption,
                                                                    String falseCaption)
        Constructs a new Boolean based ItemComboBoxModel with null as the initially selected value.
        Parameters:
        nullCaption - the string representing a null value
        trueCaption - the string representing the boolean value 'true'
        falseCaption - the string representing the boolean value 'false'
        Returns:
        a Boolean based ItemComboBoxModel