01: /*
02: * ClipboardWrapper.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.components;
13:
14: import javax.swing.text.JTextComponent;
15: import workbench.interfaces.ClipboardSupport;
16:
17: /**
18: * @author support@sql-workbench.net
19: */
20: public class ClipboardWrapper implements ClipboardSupport {
21: private JTextComponent client;
22:
23: public ClipboardWrapper(JTextComponent aClient) {
24: this .client = aClient;
25: }
26:
27: public void copy() {
28: this .client.copy();
29: }
30:
31: public void clear() {
32: if (this .client.isEditable()) {
33: this .client.replaceSelection("");
34: }
35: }
36:
37: public void cut() {
38: this .client.cut();
39: }
40:
41: public void paste() {
42: this .client.paste();
43: }
44:
45: public void selectAll() {
46: this .client.select(0, this.client.getText().length());
47: }
48:
49: }
|