01: /*
02: * NextStatementAction.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: import workbench.gui.sql.SqlHistory;
20: import workbench.resource.ResourceMgr;
21:
22: /**
23: * Display the next statement from the SQL History.
24: * @author support@sql-workbench.net
25: */
26: public class NextStatementAction extends WbAction {
27: private SqlHistory history;
28:
29: public NextStatementAction(SqlHistory aHistory) {
30: super ();
31: this .history = aHistory;
32: this .initMenuDefinition("MnuTxtNextStatement", KeyStroke
33: .getKeyStroke(KeyEvent.VK_RIGHT, InputEvent.ALT_MASK));
34: this .setIcon(ResourceMgr.getImage("Forward"));
35: this .setMenuItemName(ResourceMgr.MNU_TXT_SQL);
36: this .setCreateMenuSeparator(false);
37: this .setCreateToolbarSeparator(false);
38: //this.putValue(ALTERNATE_ACCELERATOR, KeyStroke.getKeyStroke(KeyEvent.VK_N, InputEvent.CTRL_MASK));
39: }
40:
41: public void executeAction(ActionEvent e) {
42: this.history.showNextStatement();
43: }
44: }
|