01: /*
02: * TablePopup.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.menu;
13:
14: import javax.swing.Action;
15: import javax.swing.JPopupMenu;
16:
17: import workbench.gui.actions.ClearAction;
18: import workbench.gui.actions.CopyAction;
19: import workbench.gui.actions.CutAction;
20: import workbench.gui.actions.PasteAction;
21: import workbench.gui.actions.SelectAllAction;
22: import workbench.gui.actions.WbAction;
23: import workbench.interfaces.ClipboardSupport;
24:
25: /**
26: * @author support@sql-workbench.net
27: */
28: public class TablePopup extends JPopupMenu {
29: private CopyAction copy;
30: private PasteAction paste;
31: private ClearAction clear;
32: private SelectAllAction selectAll;
33: private CutAction cut;
34:
35: /** Creates new LogPanelPopup */
36: public TablePopup(ClipboardSupport aClient) {
37: this .cut = new CutAction(aClient);
38: this .add(cut);
39: this .copy = new CopyAction(aClient);
40: this .add(this .copy);
41: this .paste = new PasteAction(aClient);
42: this .add(this .paste);
43: this .addSeparator();
44: this .clear = new ClearAction(aClient);
45: this .add(this .clear);
46: this .selectAll = new SelectAllAction(aClient);
47: this .add(this .selectAll);
48: }
49:
50: public void addAction(Action anAction, boolean withSep) {
51: if (withSep)
52: this .addSeparator();
53: this .add(anAction);
54: }
55:
56: public WbAction getCopyAction() {
57: return this .copy;
58: }
59:
60: public WbAction getCutAction() {
61: return this .cut;
62: }
63:
64: public WbAction getPasteAction() {
65: return this .paste;
66: }
67:
68: public WbAction getSelectAllAction() {
69: return this .selectAll;
70: }
71:
72: public WbAction getClearAction() {
73: return this.clear;
74: }
75: }
|