Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: com/sshtools/apps/NewWindowAction.java


1   /**
2    *   Sshtools - Applications
3    *
4    *   Copyright (C) 2002 Lee David Painter
5    *
6    *   Written by: 2002 Lee David Painter <lee@sshtools.com>
7    *
8    *   This program is free software; you can redistribute it and/or modify
9    *   it under the terms of the GNU General Public License as published by
10   *   the Free Software Foundation; either version 2 of the License, or
11   *   (at your option) any later version.
12   *
13   *   This program is distributed in the hope that it will be useful,
14   *   but WITHOUT ANY WARRANTY; without even the implied warranty of
15   *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16   *   GNU General Public License for more details.
17   *
18   *   You should have received a copy of the GNU General Public License
19   *   along with this program; if not, write to the Free Software
20   *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
21   */
22  package com.sshtools.apps;
23  import javax.swing.Action;
24  import java.awt.event.*;
25  import com.sshtools.apps.*;
26  
27  /**
28   *  Describes the New window action for the Sshtools applications
29   *
30   *@author     Brett Smith
31   *@created    31 August 2002
32   *@version    $Id: NewWindowAction.java,v 1.1 2003/01/20 14:28:12 t_magicthize Exp $
33   */
34  public class NewWindowAction extends StandardAction {
35  
36      protected org.apache.log4j.Logger log =
37              org.apache.log4j.Logger.getLogger(NewWindowAction.class);
38      /**
39       *  Constructor
40       */
41      public NewWindowAction(SshToolsApplication application) {
42          this.application = application;
43  
44          putValue(Action.NAME, "New Window");
45          putValue(Action.SMALL_ICON, getIcon("newwindow.png"));
46          putValue(LARGE_ICON, getIcon("largenewwindow.png"));
47          putValue(Action.SHORT_DESCRIPTION, "Create new window");
48          putValue(Action.LONG_DESCRIPTION, "Create a new SSHTerm window");
49          putValue(Action.MNEMONIC_KEY, new Integer('w'));
50          putValue(Action.ACTION_COMMAND_KEY, "new-window");
51          putValue(StandardAction.ON_MENUBAR, new Boolean(true));
52          putValue(StandardAction.MENU_NAME, "File");
53          putValue(StandardAction.MENU_ITEM_GROUP, new Integer(0));
54          putValue(StandardAction.MENU_ITEM_WEIGHT, new Integer(90));
55          putValue(StandardAction.ON_TOOLBAR, new Boolean(true));
56          putValue(StandardAction.TOOLBAR_GROUP, new Integer(0));
57          putValue(StandardAction.TOOLBAR_WEIGHT, new Integer(90));
58      }
59  
60      public void actionPerformed(ActionEvent evt) {
61          try {
62              application.newContainer();
63          }
64          catch(SshToolsApplicationException stae) {
65              log.error(stae);
66          }
67      }
68  
69      //
70  
71      private SshToolsApplication application;
72  }