01: /*
02: * Copyright (C) The Apache Software Foundation. All rights reserved.
03: *
04: * This software is published under the terms of the Apache Software
05: * License version 1.1, a copy of which has been included with this
06: * distribution in the APACHE.txt file. */
07: package org.jahia.sqlprofiler.gui;
08:
09: import java.awt.event.ActionEvent;
10: import javax.swing.AbstractAction;
11: import org.apache.log4j.Category;
12:
13: /**
14: * Encapsulates the action to exit.
15: *
16: * @author <a href="mailto:oliver@puppycrawl.com">Oliver Burn</a>
17: * @version 1.0
18: */
19: class ExitAction extends AbstractAction {
20: /** use to log messages **/
21: private static final Category LOG = Category
22: .getInstance(ExitAction.class);
23: /** The instance to share **/
24: public static final ExitAction INSTANCE = new ExitAction();
25:
26: /** Stop people creating instances **/
27: private ExitAction() {
28: }
29:
30: /**
31: * Will shutdown the application.
32: * @param aIgnore ignored
33: */
34: public void actionPerformed(ActionEvent aIgnore) {
35: LOG.info("shutting down");
36: System.exit(0);
37: }
38: }
|