01: /*
02: * CopyProfileAction.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.FileActions;
17: import workbench.log.LogMgr;
18: import workbench.resource.ResourceMgr;
19:
20: /**
21: * Action to copy a connection profile in the connect dialog.
22: *
23: * @author support@sql-workbench.net
24: */
25: public class CopyProfileAction extends WbAction {
26: private FileActions client;
27:
28: public CopyProfileAction(FileActions aClient) {
29: this .client = aClient;
30: this .setIcon(ResourceMgr.getImage("CopyProfile"));
31: this .initMenuDefinition("LblCopyProfile");
32: }
33:
34: public void executeAction(ActionEvent e) {
35: try {
36: this .client.newItem(true);
37: } catch (Exception ex) {
38: LogMgr.logError("NewListEntryAction.executeAction()",
39: "Error copying profile", ex);
40: }
41:
42: }
43: }
|