View Javadoc

1   /*
2    * $Id: ExitAction.java,v 1.6 2007/07/04 19:42:49 edankert Exp $
3    *
4    * The contents of this file are subject to the Mozilla Public License 
5    * Version 1.1 (the "License"); you may not use this file except in 
6    * compliance with the License. You may obtain a copy of the License at 
7    * http://www.mozilla.org/MPL/ 
8    *
9    * Software distributed under the License is distributed on an "AS IS" basis, 
10   * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 
11   * for the specific language governing rights and limitations under the License.
12   *
13   * The Original Code is XML Hammer code. (org.xmlhammer.*)
14   *
15   * The Initial Developer of the Original Code is Edwin Dankert. Portions created 
16   * by the Initial Developer are Copyright (C) 2005 - 2006 the Initial Developer. 
17   * All Rights Reserved.
18   *
19   * Contributor(s): Edwin Dankert <edankert@gmail.com>
20   */
21  package org.xmlhammer.gui.actions;
22  
23  import org.bounce.RunnableAction;
24  import org.xmlhammer.gui.XMLHammer;
25  
26  /***
27   * An action that can be used to open a XML Document.
28   *
29   * @version	$Revision: 1.6 $, $Date: 2007/07/04 19:42:49 $
30   * @author Edwin Dankert <edankert@gmail.com>
31   */
32  public class ExitAction extends RunnableAction {
33   	private static final long serialVersionUID = 2125432050043422953L;
34  
35  	private XMLHammer parent = null;
36  
37   	/***
38  	 * The constructor for the action which exits the XML Hammer.
39  	 *
40  	 * @param parent the XML Hammer.
41  	 */
42   	public ExitAction( XMLHammer parent) {
43   		super( "Exit");
44  		
45  		this.parent = parent;
46  
47  		putValue( MNEMONIC_KEY, new Integer( 'x'));
48  		putValue( SHORT_DESCRIPTION, "Exit");
49   	}
50   	
51   	/***
52  	 * The implementation of the exit action, called after a user action.
53  	 */
54   	public void run() {
55   		parent.fireClosingEvent();
56   	}
57  }