/*
 * Fenix Planner
 * Copyright (C) 2013 Petter Holmström
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as
 * published by the Free Software Foundation, either version 3 of the
 * License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
package com.github.peholmst.fenix.planner.ui.actions;

import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.KeyEvent;
import javax.swing.AbstractAction;
import javax.swing.JFrame;
import javax.swing.KeyStroke;

/**
 * Action that quits the application.
 *
 * @author Petter Holmström
 */
public class QuitAction extends AbstractAction {

    private final JFrame mainFrame;

    public QuitAction(JFrame mainFrame) {
        this.mainFrame = mainFrame;
        putValue(SHORT_DESCRIPTION, "Sparar alla ändringar och avslutar programmet");
        putValue(NAME, "Avsluta");
        putValue(MNEMONIC_KEY, KeyEvent.VK_A);
        putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_Q,
                Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()));
    }

    @Override
    public void actionPerformed(ActionEvent e) {
        mainFrame.setVisible(false);
    }

}

@@ -912,35 +912,8 @@
 on;%0A
-import javax.swing.JFrame;%0A
 impo
@@ -938,16 +938,16 @@
 Stroke;%0A
+
 %0A/**%0A * 
@@ -1075,117 +1075,28 @@
    p
-rivate final JFrame mainFrame;%0A%0A    public QuitAction(JFrame mainFrame) %7B%0A        this.mainFrame = mainFrame;
+ublic QuitAction() %7B
 %0A   
@@ -1168,18 +1168,21 @@
 tar 
-programmet
+applikationen
 %22);%0A
@@ -1489,34 +1489,21 @@
     
-mainFrame.setVisible(false
+System.exit(0
 );%0A 

Quit action now calls System.exit()