01: /*
02: * AddTabAction.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.gui.MainWindow;
21: import workbench.resource.ResourceMgr;
22:
23: /**
24: * Action to add a new tab to the MainWindow's interface
25: *
26: * @see workbench.gui.MainWindow
27: * @see workbench.gui.MainWindow#addTab()
28: *
29: * @author support@sql-workbench.net
30: */
31: public class AddTabAction extends WbAction {
32: private MainWindow client;
33:
34: public AddTabAction(MainWindow aClient) {
35: super ();
36: this .client = aClient;
37: this .setMenuItemName(ResourceMgr.MNU_TXT_VIEW);
38: this .initMenuDefinition("MnuTxtAddTab", KeyStroke.getKeyStroke(
39: KeyEvent.VK_T, InputEvent.CTRL_MASK));
40: this .setIcon(null);
41: }
42:
43: public void executeAction(ActionEvent e) {
44: this.client.addTab();
45: }
46: }
|