01: /*
02: * CopyAction.java
03: *
04: * This file is part of SQL Workbench/J, http://www.sql-workbench.net
05: *
06: * Copyright 2002-2008, Thomas Kellerer
07: * No part of this code maybe reused without the permission of the author
08: *
09: * To contact the author please send an email to: support@sql-workbench.net
10: *
11: */
12: package workbench.gui.actions;
13:
14: import java.awt.event.ActionEvent;
15: import java.awt.event.InputEvent;
16: import java.awt.event.KeyEvent;
17:
18: import javax.swing.KeyStroke;
19:
20: import workbench.interfaces.ClipboardSupport;
21: import workbench.resource.ResourceMgr;
22:
23: /**
24: * Action to copy the contents of a entry field into the clipboard
25: * @author support@sql-workbench.net
26: */
27: public class CopyAction extends WbAction {
28: private ClipboardSupport client;
29:
30: public CopyAction(ClipboardSupport aClient) {
31: super ();
32: this .client = aClient;
33: this .setMenuTextByKey("MnuTxtCopy");
34: this .setIcon(ResourceMgr.getImage("Copy"));
35: this .setMenuItemName(ResourceMgr.MNU_TXT_EDIT);
36: this .setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_C,
37: InputEvent.CTRL_MASK));
38: }
39:
40: public void executeAction(ActionEvent e) {
41: this.client.copy();
42: }
43: }
|