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