src/net/java/sip/communicator/impl/neomedia/MediaConfigurationImpl.java
/**
         * Adds a listener to the field.
         * @param listener the listener to be added.
         */
Adds a listener to the field.
@param listener the listener to be added.
Adds a listener to the field . @param listener the listener to be added .
public void addListener(final Listener listener)
        {
            this.listener = listener;
            if(deviceComboBox != null)
            {
                deviceComboBox.addActionListener(new ActionListener()
                {
                    @Override
                    public void actionPerformed(ActionEvent e)
                    {
                        listener.onAction();
                    }
                });
            }
            else
            {
                deviceList.addListSelectionListener(new ListSelectionListener()
                {
                    @Override
                    public void valueChanged(ListSelectionEvent e)
                    {
                        model.setSelectedItem(deviceList.getSelectedValue());
                        if (e.getValueIsAdjusting())
                        {
                            return;
                        }
                        listener.onAction();
                    }
                });
            }
        }
public void addListener ( final Listener listener ) { this . listener = listener ; if ( deviceComboBox != null ) { deviceComboBox . addActionListener ( new ActionListener ( ) { @ Override public void actionPerformed ( ActionEvent e ) { listener . onAction ( ) ; } } ) ; } else { deviceList . addListSelectionListener ( new ListSelectionListener ( ) { @ Override public void valueChanged ( ListSelectionEvent e ) { model . setSelectedItem ( deviceList . getSelectedValue ( ) ) ; if ( e . getValueIsAdjusting ( ) ) { return ; } listener . onAction ( ) ; } } ) ; } }
Adds a listener to the field.
Adds a listener to the field .
// the list is still changing, but we're only // interested in the final state