01: /*
02: * LastStatementAction.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.sql.SqlHistory;
21: import workbench.resource.ResourceMgr;
22:
23: /**
24: * Jump to the last statement in the SQL History
25: * @author support@sql-workbench.net
26: */
27: public class LastStatementAction extends WbAction {
28: private SqlHistory history;
29:
30: public LastStatementAction(SqlHistory aHistory) {
31: super ();
32: this .history = aHistory;
33: this .initMenuDefinition("MnuTxtLastStatement", KeyStroke
34: .getKeyStroke(KeyEvent.VK_RIGHT, InputEvent.ALT_MASK
35: | InputEvent.SHIFT_MASK));
36: this .setIcon(ResourceMgr.getImage("Last"));
37: this .setMenuItemName(ResourceMgr.MNU_TXT_SQL);
38: this .setCreateMenuSeparator(false);
39: this .setCreateToolbarSeparator(false);
40: }
41:
42: public void executeAction(ActionEvent e) {
43: this.history.showLastStatement();
44: }
45: }
|