01: /*
02: * InsertRowAction.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: * Insert a new row
21: * @author support@sql-workbench.net
22: */
23: public class InsertRowAction extends WbAction {
24: private DbData client;
25:
26: public InsertRowAction(DbData aClient) {
27: super ();
28: this .client = aClient;
29: this .initMenuDefinition("MnuTxtInsertRow");
30: this .setIcon(ResourceMgr.getImage("RowInsertAfter"));
31: this .setMenuItemName(ResourceMgr.MNU_TXT_DATA);
32: this .setEnabled(false);
33: }
34:
35: public void executeAction(ActionEvent e) {
36: this .client.addRow();
37: }
38:
39: public void setClient(DbData db) {
40: this.client = db;
41: }
42: }
|