KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > piratepete > dbpirate > ui > actions > NewConnectionAction


1 /**
2  * NewConnectionAction Class
3  * Copyright (C) 2003 Jeremy Whitlock<p>
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU General Public License
7  * as published by the Free Software Foundation; either version 2
8  * of the License, or (at your option) any later version.<p>
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.<p>
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.<p>
18  *
19  * <a HREF="http://www.piratepetesoftware.com">piratepetesoftware.com</a><br>
20  * <a HREF="mailto:dlwhitehurst@comcast.net">dlwhitehurst@comcast.net</a>
21  *
22  * @version 1.1.0
23  */

24 package com.piratepete.dbpirate.ui.actions;
25
26 import java.awt.event.ActionEvent JavaDoc;
27 import javax.swing.AbstractAction JavaDoc;
28 import javax.swing.Icon JavaDoc;
29 import com.piratepete.dbpirate.CommandManager;
30 import com.piratepete.dbpirate.Const;
31
32 public class NewConnectionAction extends AbstractAction JavaDoc {
33     
34     /**
35      * Constructor Method
36      *
37      */

38     
39     public NewConnectionAction(String JavaDoc name, Icon JavaDoc icon, String JavaDoc desc, Integer JavaDoc mnemonic)
40     {
41         super(name);
42         putValue(SMALL_ICON, icon);
43         putValue(SHORT_DESCRIPTION, desc + " (Ctrl+N)");
44         putValue(MNEMONIC_KEY, mnemonic);
45     }
46     
47     /**
48      * Action Performed Method
49      *
50      */

51     
52     public void actionPerformed(ActionEvent JavaDoc e)
53     {
54         System.out.println("New Connection Requested!");
55         CommandManager.run(Const.CMD_NEWCONNECTION);
56     }
57     
58 }
59
Popular Tags