01: /*
02: * DataPumperAction.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.db.ConnectionProfile;
17: import workbench.gui.MainWindow;
18: import workbench.gui.WbSwingUtilities;
19: import workbench.gui.tools.DataPumper;
20: import workbench.resource.ResourceMgr;
21: import workbench.resource.Settings;
22:
23: /**
24: * Action to display the DataPumper window
25: * @see workbench.gui.tools.DataPumper
26: * @author support@sql-workbench.net
27: */
28: public class DataPumperAction extends WbAction {
29: private MainWindow parent;
30:
31: public DataPumperAction(MainWindow win) {
32: super ();
33: this .initMenuDefinition("MnuTxtDataPumper");
34: this .setMenuItemName(ResourceMgr.MNU_TXT_TOOLS);
35: this .setIcon(ResourceMgr.getImage("DataPumper"));
36: this .parent = win;
37: }
38:
39: public void executeAction(ActionEvent e) {
40: if (parent != null) {
41: WbSwingUtilities.showWaitCursor(parent);
42: }
43: try {
44: ConnectionProfile profile = null;
45: if (parent != null
46: && Settings.getInstance()
47: .getAutoConnectDataPumper()) {
48: profile = parent.getCurrentProfile();
49: }
50: DataPumper p = new DataPumper(profile, null);
51: p.showWindow(parent);
52: } finally {
53: if (parent != null)
54: WbSwingUtilities.showDefaultCursor(parent);
55: }
56: }
57:
58: }
|