01: /*
02: * ClearStatementHistoryAction.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 workbench.gui.sql.SqlHistory;
16: import workbench.resource.ResourceMgr;
17:
18: /**
19: * Action to remove all entries from the SQL history
20: * @see workbench.gui.sql.SqlHistory
21: *
22: * @author support@sql-workbench.net
23: */
24: public class ClearStatementHistoryAction extends WbAction {
25: private SqlHistory history;
26:
27: public ClearStatementHistoryAction(SqlHistory aHistory) {
28: super ();
29: this .history = aHistory;
30: this .initMenuDefinition("MnuTxtClearSqlHistory");
31: this .setMenuItemName(ResourceMgr.MNU_TXT_SQL);
32: this .setCreateMenuSeparator(false);
33: this .setCreateToolbarSeparator(false);
34: }
35:
36: public void executeAction(ActionEvent e) {
37: this.history.clear();
38: }
39: }
|