01: /*
02: * FileReloadAction.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.KeyEvent;
16:
17: import javax.swing.KeyStroke;
18: import workbench.gui.sql.EditorPanel;
19: import workbench.resource.ResourceMgr;
20:
21: /**
22: * Reload the currently loaded file in the SQL Editor
23: * @author support@sql-workbench.net
24: */
25: public class FileReloadAction extends WbAction {
26: private EditorPanel client;
27:
28: public FileReloadAction(EditorPanel aClient) {
29: super ();
30: this .client = aClient;
31: this .initMenuDefinition("MnuTxtFileReload", KeyStroke
32: .getKeyStroke(KeyEvent.VK_F5, KeyEvent.SHIFT_MASK));
33: this .setMenuItemName(ResourceMgr.MNU_TXT_FILE);
34: this .setEnabled(aClient.hasFileLoaded());
35: }
36:
37: public void executeAction(ActionEvent e) {
38: this.client.reloadFile();
39: }
40: }
|