01: /*
02: * CopyRowAction.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.DbData;
17: import workbench.resource.ResourceMgr;
18:
19: /**
20: * Action to create a copy of the currently selected row in a table.
21: * @see workbench.interfaces.DbData
22: * @author support@sql-workbench.net
23: */
24: public class CopyRowAction extends WbAction {
25: private DbData client;
26:
27: public CopyRowAction(DbData aClient) {
28: super ();
29: this .client = aClient;
30: this .initMenuDefinition("MnuTxtCopyRow");
31: this .setIcon(ResourceMgr.getImage("CopyRow"));
32: this .setMenuItemName(ResourceMgr.MNU_TXT_DATA);
33: this .setEnabled(false);
34: }
35:
36: public void executeAction(ActionEvent e) {
37: this .client.duplicateRow();
38: }
39:
40: public void setClient(DbData db) {
41: this.client = db;
42: }
43:
44: }
|