Class BeanListComboBoxCellEditor<T extends java.lang.Comparable<? super T>>

  • Type Parameters:
    T - list item class
    All Implemented Interfaces:
    java.io.Serializable, javax.swing.CellEditor, javax.swing.table.TableCellEditor, javax.swing.tree.TreeCellEditor
    Direct Known Subclasses:
    EditableComboBoxCellEditor

    public abstract class BeanListComboBoxCellEditor<T extends java.lang.Comparable<? super T>>
    extends ComboBoxCellEditor
    Provides a cell editor (BeanListComboBox) for selecting from a list of beans. Provides the option to load the list items lazily the first time a cell is edited.
    See Also:
    Serialized Form
    • Nested Class Summary

      • Nested classes/interfaces inherited from class javax.swing.DefaultCellEditor

        javax.swing.DefaultCellEditor.EditorDelegate
    • Field Summary

      • Fields inherited from class javax.swing.DefaultCellEditor

        clickCountToStart, delegate, editorComponent
      • Fields inherited from class javax.swing.AbstractCellEditor

        changeEvent, listenerList
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected BeanListComboBoxCellEditor​(BeanListComboBox<T> comboBox, java.lang.String loadingMessage)
      Create a combo box cell editor for an optional field.
      protected BeanListComboBoxCellEditor​(java.text.Format format, java.lang.String loadingMessage)
      Create a combo box cell editor for an optional field.
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      void addListItems​(java.util.Collection<T> newItems)
      Add items to the drop down list.
      protected BeanListComboBox<T> getComboBox()  
      protected LazyLoadComboBoxModel<T> getComboBoxModel()  
      protected abstract java.util.List<T> getComboBoxValues()
      Must be implemented to provide the list items.
      java.awt.Component getTableCellEditorComponent​(javax.swing.JTable table, java.lang.Object value, boolean isSelected, int row, int column)
      Overridden start a background thread to load the list values if they haven't been loaded yet,
      java.awt.Component getTreeCellEditorComponent​(javax.swing.JTree tree, java.lang.Object value, boolean isSelected, boolean expanded, boolean leaf, int row)
      Overridden start a background thread to load the list values if they haven't been loaded yet,
      void setListItems​(java.util.List<T> items)
      Set the list items.
      • Methods inherited from class javax.swing.DefaultCellEditor

        cancelCellEditing, getCellEditorValue, getClickCountToStart, getComponent, isCellEditable, setClickCountToStart, shouldSelectCell, stopCellEditing
      • Methods inherited from class javax.swing.AbstractCellEditor

        addCellEditorListener, fireEditingCanceled, fireEditingStopped, getCellEditorListeners, removeCellEditorListener
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface javax.swing.CellEditor

        addCellEditorListener, removeCellEditorListener
    • Constructor Detail

      • BeanListComboBoxCellEditor

        protected BeanListComboBoxCellEditor​(java.text.Format format,
                                             java.lang.String loadingMessage)
        Create a combo box cell editor for an optional field.
      • BeanListComboBoxCellEditor

        protected BeanListComboBoxCellEditor​(BeanListComboBox<T> comboBox,
                                             java.lang.String loadingMessage)
        Create a combo box cell editor for an optional field.
    • Method Detail

      • getTableCellEditorComponent

        public java.awt.Component getTableCellEditorComponent​(javax.swing.JTable table,
                                                              java.lang.Object value,
                                                              boolean isSelected,
                                                              int row,
                                                              int column)
        Overridden start a background thread to load the list values if they haven't been loaded yet,
        Specified by:
        getTableCellEditorComponent in interface javax.swing.table.TableCellEditor
        Overrides:
        getTableCellEditorComponent in class javax.swing.DefaultCellEditor
        See Also:
        getComboBoxValues()
      • getTreeCellEditorComponent

        public java.awt.Component getTreeCellEditorComponent​(javax.swing.JTree tree,
                                                             java.lang.Object value,
                                                             boolean isSelected,
                                                             boolean expanded,
                                                             boolean leaf,
                                                             int row)
        Overridden start a background thread to load the list values if they haven't been loaded yet,
        Specified by:
        getTreeCellEditorComponent in interface javax.swing.tree.TreeCellEditor
        Overrides:
        getTreeCellEditorComponent in class javax.swing.DefaultCellEditor
        See Also:
        getComboBoxValues()
      • setListItems

        public void setListItems​(java.util.List<T> items)
        Set the list items. Disables background loading of the list items.
      • addListItems

        public void addListItems​(java.util.Collection<T> newItems)
        Add items to the drop down list.