01: /*
02: * ReloadAction.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:
16: import workbench.interfaces.Reloadable;
17: import workbench.resource.ResourceMgr;
18:
19: /**
20: * @author support@sql-workbench.net
21: */
22: public class ReloadAction extends WbAction {
23: private Reloadable client;
24: private boolean ctrlPressed;
25:
26: public ReloadAction(Reloadable aClient) {
27: super ();
28: this .client = aClient;
29: this .initMenuDefinition("TxtReload");
30: this .setIcon(ResourceMgr.getImage("Refresh"));
31: }
32:
33: public boolean ctrlPressed() {
34: return ctrlPressed;
35: }
36:
37: public void executeAction(ActionEvent e) {
38: this .ctrlPressed = isCtrlPressed(e);
39: this .client.reload();
40: }
41:
42: public boolean allowDuplicate() {
43: return false;
44: }
45:
46: }
|