< prev index next >

## src/java.desktop/share/classes/javax/swing/MutableComboBoxModel.java

Print this page

    rev 48358 : Work in progress for JDK-6303622
    Use generic in Swing components like JComboBox
    1. Added generic return type and parameter type for JComboBox.
    2. Modified JList related classes as well.

      34  */
      35
      36 public interface MutableComboBoxModel<E> extends ComboBoxModel<E> {
      37
      38     /**
      39      * Adds an item at the end of the model. The implementation of this method
      40      * should notify all registered <code>ListDataListener</code>s that the
      41      * item has been added.
      42      *
      43      * @param item the item to be added
      44      */
      45     public void addElement( E item );
      46
      47     /**
      48      * Removes an item from the model. The implementation of this method should
      49      * should notify all registered <code>ListDataListener</code>s that the
      50      * item has been removed.
      51      *
      52      * @param obj the <code>Object</code> to be removed
      53      */
      54     public void removeElement( Object obj );
      55
      56     /**
      57      * Adds an item at a specific index.  The implementation of this method
      58      * should notify all registered <code>ListDataListener</code>s that the
      59      * item has been added.
      60      *
      61      * @param item  the item to be added
      62      * @param index  location to add the object
      63      */
      64     public void insertElementAt( E item, int index );
      65
      66     /**
      67      * Removes an item at a specific index. The implementation of this method
      68      * should notify all registered <code>ListDataListener</code>s that the
      69      * item has been removed.
      70      *
      71      * @param index  location of the item to be removed
      72      */
      73     public void removeElementAt( int index );
      74 }
      34  */
      35
      36 public interface MutableComboBoxModel<E> extends ComboBoxModel<E> {
      37
      38     /**
      39      * Adds an item at the end of the model. The implementation of this method
      40      * should notify all registered <code>ListDataListener</code>s that the
      41      * item has been added.
      42      *
      43      * @param item the item to be added
      44      */
      45     public void addElement( E item );
      46
      47     /**
      48      * Removes an item from the model. The implementation of this method should
      49      * should notify all registered <code>ListDataListener</code>s that the
      50      * item has been removed.
      51      *
      52      * @param obj the <code>Object</code> to be removed
      53      */
      54     public void removeElement( E obj );
      55
      56     /**
      57      * Adds an item at a specific index.  The implementation of this method
      58      * should notify all registered <code>ListDataListener</code>s that the
      59      * item has been added.
      60      *
      61      * @param item  the item to be added
      62      * @param index  location to add the object
      63      */
      64     public void insertElementAt( E item, int index );
      65
      66     /**
      67      * Removes an item at a specific index. The implementation of this method
      68      * should notify all registered <code>ListDataListener</code>s that the
      69      * item has been removed.
      70      *
      71      * @param index  location of the item to be removed
      72      */
      73     public void removeElementAt( int index );
      74 }

< prev index next >