- /**
- * Adds the specified action listener to receive action events from this
- * {@link SearchBar}.
- *
- * @param listener the action listener to be added
- */
- public synchronized void addActionListener(ActionListener listener) {
- listenerList.add(ActionListener.class, listener);
- }
-
- /**
- * Removes the specified action listener so that it no longer receives action
- * events from this {@link SearchBar}.
- *
- * @param listener the action listener to be removed
- */
- public synchronized void removeActionListener(ActionListener listener) {
- listenerList.remove(ActionListener.class, listener);
- }
-
- /**
- * Notify the listeners of an action.
- */
- protected void fireActionPerformed() {
- ActionEvent e = new ActionEvent(this, ActionEvent.ACTION_PERFORMED, listenerCommand);
- Object[] listeners = listenerList.getListenerList();
- for (int i = listeners.length - 2; i >= 0; i -= 2) {
- if (listeners[i] == ActionListener.class) {
- ((ActionListener) listeners[i + 1]).actionPerformed(e);
- }
- }
- }
-