01: /*
02: * CopyAsSqlUpdateAction.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 workbench.gui.components.ClipBoardCopier;
16:
17: import workbench.gui.components.WbTable;
18: import workbench.resource.ResourceMgr;
19:
20: /**
21: * Action to copy the contents of the data as SQL update statements into the clipboard
22: * @see workbench.gui.components.ClipBoardCopier
23: * @author support@sql-workbench.net
24: */
25: public class CopyAsSqlUpdateAction extends WbAction {
26: private WbTable client;
27:
28: public CopyAsSqlUpdateAction(WbTable aClient) {
29: super ();
30: this .client = aClient;
31: this .initMenuDefinition("MnuTxtCopyAsSqlUpdate", null);
32: this .setMenuItemName(ResourceMgr.MNU_TXT_DATA);
33: this .setEnabled(false);
34: }
35:
36: public boolean hasCtrlModifier() {
37: return true;
38: }
39:
40: public boolean hasShiftModifier() {
41: return false;
42: }
43:
44: public void executeAction(ActionEvent e) {
45: ClipBoardCopier copier = new ClipBoardCopier(this .client);
46: copier.copyAsSql(true, false, this .isCtrlPressed(e), false);
47: }
48:
49: }
|