View Javadoc

1   /**
2    * This program is free software: you can redistribute it and/or modify
3    * it under the terms of the GNU General Public License as published by
4    * the Free Software Foundation, version 3.
5    *
6    * This program is distributed in the hope that it will be useful,
7    * but WITHOUT ANY WARRANTY; without even the implied warranty of
8    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9    * GNU General Public License for more details.
10   *
11   * You should have received a copy of the GNU General Public License
12   * along with this program. If not, see <http://www.gnu.org/licenses/>.
13   */
14  
15  package net.curre.prefcount.event;
16  
17  import java.awt.event.ActionEvent;
18  import java.awt.event.ActionListener;
19  import javax.swing.*;
20  
21  import net.curre.prefcount.PrefCountRegistry;
22  
23  /**
24   * Object of this class represents an action listener
25   * to use for quitting application.
26   * <p/>
27   * Created date: Jan 22, 2008
28   *
29   * @author Yevgeny Nyden
30   */
31  public class QuitActionListener extends AbstractAction implements ActionListener {
32  
33    /**
34     * Disposes frames and quits application.
35     *
36     * @param actionEvent Action event.
37     */
38    public void actionPerformed(ActionEvent actionEvent) {
39      PrefCountRegistry.getInstance().doQuit();
40    }
41  
42  }