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

Quick Search    Search Deep

Source code: com/sshtools/sshterm/CopyAction.java


1   /*
2    *  Sshtools - SSHTerm
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
9    *  modify it under the terms of the GNU General Public License
10   *  as published by the Free Software Foundation; either version 2 of
11   *  the License, or (at your option) any later version.
12   *  This program is distributed in the hope that it will be useful,
13   *  but WITHOUT ANY WARRANTY; without even the implied warranty of
14   *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15   *  GNU Library General Public License for more details.
16   *
17   *  You should have received a copy of the GNU General Public
18   *  License along with this program; if not, write to the Free Software
19   *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20   */
21  package com.sshtools.sshterm;
22  
23  import com.sshtools.apps.StandardAction;
24  
25  import java.awt.event.KeyEvent;
26  
27  import javax.swing.Action;
28  import javax.swing.KeyStroke;
29  
30  
31  public class CopyAction extends StandardAction {
32      private final static String ACTION_COMMAND_KEY_COPY = "copy-command";
33      private final static String NAME_COPY = "Copy";
34      private final static String SMALL_ICON_COPY = "copy.png";
35      private final static String LARGE_ICON_COPY = "";
36      private final static String SHORT_DESCRIPTION_COPY = "Copy selection";
37      private final static String LONG_DESCRIPTION_COPY = "Copy the current selection to the clipboard";
38      private final static int MNEMONIC_KEY_COPY = 'C';
39  
40      public CopyAction() {
41          putValue(Action.NAME, NAME_COPY);
42          putValue(Action.SMALL_ICON, getIcon(SMALL_ICON_COPY));
43          putValue(LARGE_ICON, getIcon(LARGE_ICON_COPY));
44          putValue(Action.ACCELERATOR_KEY,
45              KeyStroke.getKeyStroke(KeyEvent.VK_C, KeyEvent.ALT_MASK));
46          putValue(Action.SHORT_DESCRIPTION, SHORT_DESCRIPTION_COPY);
47          putValue(Action.LONG_DESCRIPTION, LONG_DESCRIPTION_COPY);
48          putValue(Action.MNEMONIC_KEY, new Integer(MNEMONIC_KEY_COPY));
49          putValue(Action.ACTION_COMMAND_KEY, ACTION_COMMAND_KEY_COPY);
50          putValue(StandardAction.ON_MENUBAR, new Boolean(true));
51          putValue(StandardAction.MENU_NAME, "Edit");
52          putValue(StandardAction.MENU_ITEM_GROUP, new Integer(10));
53          putValue(StandardAction.MENU_ITEM_WEIGHT, new Integer(0));
54          putValue(StandardAction.ON_TOOLBAR, new Boolean(true));
55          putValue(StandardAction.TOOLBAR_GROUP, new Integer(10));
56          putValue(StandardAction.TOOLBAR_WEIGHT, new Integer(0));
57      }
58  }