01: /*
02: * TextPopup.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 workbench.gui.actions.ClearAction;
15: import workbench.gui.actions.SelectAllAction;
16: import workbench.gui.actions.WbAction;
17: import workbench.interfaces.ClipboardSupport;
18:
19: /**
20: * An popup menu which adds a clear and select all action to the
21: * {@link CutCopyPastePopup} menu.
22: *
23: * @author support@sql-workbench.net
24: */
25: public class TextPopup extends CutCopyPastePopup {
26: private ClearAction clear;
27: private SelectAllAction selectAll;
28:
29: public TextPopup(ClipboardSupport aClient) {
30: super (aClient);
31: this .addSeparator();
32: this .clear = new ClearAction(aClient);
33: this .add(this .clear.getMenuItem());
34: this .selectAll = new SelectAllAction(aClient);
35: this .add(this .selectAll.getMenuItem());
36: }
37:
38: /**
39: * Add another action to this popup menu.
40: * @param anAction the action to be added
41: * @param withSep if true a separator is added to the menu before adding the action
42: */
43: public void addAction(WbAction anAction, boolean withSep) {
44: if (withSep)
45: this .addSeparator();
46: this .add(anAction.getMenuItem());
47: }
48:
49: public WbAction getSelectAllAction() {
50: return this .selectAll;
51: }
52:
53: public WbAction getClearAction() {
54: return this.clear;
55: }
56: }
|