01: /*
02: * DeleteRowAction.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: * Delete the currently highlighted row(s) from a table
21: * @see workbench.interfaces.DbData
22: * @see workbench.gui.sql.DwPanel
23: * @author support@sql-workbench.net
24: */
25: public class DeleteRowAction extends WbAction {
26: private DbData client;
27:
28: public DeleteRowAction(DbData aClient) {
29: super ();
30: this .client = aClient;
31: this .setEnabled(false);
32: this .initMenuDefinition("MnuTxtDeleteRow");
33: this .setIcon(ResourceMgr.getImage("Delete"));
34: this .setMenuItemName(ResourceMgr.MNU_TXT_DATA);
35: }
36:
37: public void executeAction(ActionEvent e) {
38: this .client.deleteRow();
39: }
40:
41: public void setClient(DbData db) {
42: this.client = db;
43: }
44: }
|