Class EnumComboBox

    • Constructor Detail

      • EnumComboBox

        public EnumComboBox​(Class<T> enumClass)
        Convenience constructor.

        Equivalent to:

        EnumComboBox(enumClass, EnumContainer.TO_STRING_PROPERTY.getName(), true);
        Type Parameters:
        T - enum type
        Parameters:
        enumClass - enum type, or null to leave data source unset
      • EnumComboBox

        public EnumComboBox​(Class<T> enumClass,
                            boolean allowNull)
        Convenience constructor.

        Equivalent to:

        EnumComboBox(enumClass, EnumContainer.TO_STRING_PROPERTY, allowNull);
        Type Parameters:
        T - enum type
        Parameters:
        enumClass - enum type, or null to leave data source unset
        allowNull - true to allow a null selection, false otherwise
      • EnumComboBox

        public EnumComboBox​(Class<T> enumClass,
                            String displayPropertyName)
        Convenience constructor.

        Equivalent to:

        EnumComboBox(enumClass, displayPropertyName, false);
        Type Parameters:
        T - enum type
        Parameters:
        enumClass - enum type
        displayPropertyName - container property to display in the combo box
      • EnumComboBox

        public EnumComboBox​(Class<T> enumClass,
                            String displayPropertyName,
                            boolean allowNull)
        Convenience constructor.

        Equivalent to:

        EnumComboBox(enumClass != null ? new EnumContainer<T>(enumClass) : null, displayPropertyName, allowNull);
        Type Parameters:
        T - enum type
        Parameters:
        enumClass - enum type, or null to leave data source unset
        displayPropertyName - container property to display in the combo box
        allowNull - true to allow a null selection, false otherwise
      • EnumComboBox

        public EnumComboBox​(EnumContainer<?> container,
                            String displayPropertyName,
                            boolean allowNull)
        Primary constructor.

        This instance is configured for item caption AbstractSelect.ItemCaptionMode.PROPERTY mode, with displayPropertyName as the item caption property.

        Parameters:
        container - container data source, or null to leave data source unset
        displayPropertyName - container property to display in the combo box
        allowNull - true to allow a null selection, false otherwise
    • Method Detail

      • setEnumDataSource

        public <T extends Enum<T>> void setEnumDataSource​(Class<T> enumClass)
        Set the Enum type whose instances serve as this instance's data source.
        Type Parameters:
        T - enum type
        Parameters:
        enumClass - enum class instance
        Throws:
        IllegalArgumentException - if enumClass is null