Class BeanListComboBoxEditor<T>

  • Type Parameters:
    T - BeanListComboBox list item class
    All Implemented Interfaces:
    java.awt.event.FocusListener, java.util.EventListener, javax.swing.ComboBoxEditor

    public class BeanListComboBoxEditor<T>
    extends javax.swing.plaf.basic.BasicComboBoxEditor
    Provides the text field (ValidatedTextField) for an editable BeanListComboBox. Uses Format.parseObject(String) to create an item from the input text.
    • Nested Class Summary

      • Nested classes/interfaces inherited from class javax.swing.plaf.basic.BasicComboBoxEditor

        javax.swing.plaf.basic.BasicComboBoxEditor.UIResource
    • Field Summary

      • Fields inherited from class javax.swing.plaf.basic.BasicComboBoxEditor

        editor
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      ValidatedTextField getEditorComponent()  
      protected java.lang.String getFirstMatch​(java.lang.String displayText)  
      T getItem()  
      protected T getItem​(java.lang.String displayText)  
      boolean isAutoSelecting()  
      boolean isNew​(java.lang.Object item)  
      protected java.lang.String itemToString​(java.lang.Object item)  
      protected T parseInput​(java.lang.String displayText)  
      void setItem​(java.lang.Object anObject)  
      • Methods inherited from class javax.swing.plaf.basic.BasicComboBoxEditor

        addActionListener, createEditorComponent, focusGained, focusLost, removeActionListener, selectAll
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • BeanListComboBoxEditor

        public BeanListComboBoxEditor​(javax.swing.JComboBox<T> comboBox,
                                      java.text.Format format,
                                      Validator<java.lang.String> validator)
        Create a combo box editor with the default PrefixSelector (first match alphabetically).
      • BeanListComboBoxEditor

        public BeanListComboBoxEditor​(javax.swing.JComboBox<T> comboBox,
                                      java.text.Format format,
                                      Validator<java.lang.String> validator,
                                      PrefixSelector<T> prefixSelector)
    • Method Detail

      • isAutoSelecting

        public boolean isAutoSelecting()
      • getEditorComponent

        public ValidatedTextField getEditorComponent()
        Specified by:
        getEditorComponent in interface javax.swing.ComboBoxEditor
        Overrides:
        getEditorComponent in class javax.swing.plaf.basic.BasicComboBoxEditor
      • setItem

        public void setItem​(java.lang.Object anObject)
        Specified by:
        setItem in interface javax.swing.ComboBoxEditor
        Overrides:
        setItem in class javax.swing.plaf.basic.BasicComboBoxEditor
      • getItem

        public T getItem()
        Specified by:
        getItem in interface javax.swing.ComboBoxEditor
        Overrides:
        getItem in class javax.swing.plaf.basic.BasicComboBoxEditor
      • isNew

        public boolean isNew​(java.lang.Object item)
      • getItem

        protected T getItem​(java.lang.String displayText)
      • parseInput

        protected T parseInput​(java.lang.String displayText)
      • itemToString

        protected java.lang.String itemToString​(java.lang.Object item)
      • getFirstMatch

        protected java.lang.String getFirstMatch​(java.lang.String displayText)