01: /*
02: * FileSaveProfiles.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.WbManager;
17: import workbench.db.ConnectionMgr;
18: import workbench.util.ExceptionUtil;
19: import workbench.gui.WbSwingUtilities;
20: import workbench.log.LogMgr;
21: import workbench.resource.ResourceMgr;
22:
23: public class FileSaveProfiles extends WbAction {
24: public FileSaveProfiles() {
25: super ();
26: this .initMenuDefinition("MnuTxtFilesSaveProfiles");
27: }
28:
29: public void executeAction(ActionEvent e) {
30: try {
31: ConnectionMgr.getInstance().saveProfiles();
32: WbSwingUtilities.showMessage(WbManager.getInstance()
33: .getCurrentWindow(), ResourceMgr
34: .getString("MsgProfilesSaved"));
35: } catch (Exception ex) {
36: LogMgr.logError("FileSaveProfiles.executeAction()",
37: "Error saving profiles", ex);
38: WbSwingUtilities.showMessage(WbManager.getInstance()
39: .getCurrentWindow(), ResourceMgr
40: .getString("ErrSavingProfiles")
41: + "\n" + ExceptionUtil.getDisplay(ex));
42: }
43: }
44: }
|