Class CompletionListModel

  • All Implemented Interfaces:
    java.io.Serializable, javax.swing.ListModel<Completion>

    class CompletionListModel
    extends javax.swing.AbstractListModel<Completion>
    A list model implementation that allows the bulk addition of elements. This is the only feature missing from DefaultListModel that we need.
    Version:
    1.0
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.List<Completion> delegate
      Container for items in this model.
      • Fields inherited from class javax.swing.AbstractListModel

        listenerList
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void clear()
      Removes all the elements from this list.
      Completion getElementAt​(int index)  
      int getSize()  
      void setContents​(java.util.Collection<Completion> contents)
      Sets the contents of this model.
      • Methods inherited from class javax.swing.AbstractListModel

        addListDataListener, fireContentsChanged, fireIntervalAdded, fireIntervalRemoved, getListDataListeners, getListeners, removeListDataListener
      • Methods inherited from class java.lang.Object

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

      • delegate

        private final java.util.List<Completion> delegate
        Container for items in this model.
    • Constructor Detail

      • CompletionListModel

        CompletionListModel()
        Constructor.
    • Method Detail

      • clear

        public void clear()
        Removes all the elements from this list. The list will be empty after this call returns (unless it throws an exception).
        See Also:
        setContents(Collection)
      • getElementAt

        public Completion getElementAt​(int index)
      • getSize

        public int getSize()
      • setContents

        public void setContents​(java.util.Collection<Completion> contents)
        Sets the contents of this model. All previous contents are removed.
        Parameters:
        contents - The new contents of this model.