home *** CD-ROM | disk | FTP | other *** search
- package sun.awt.windows;
-
- import java.awt.datatransfer.Clipboard;
- import java.awt.datatransfer.ClipboardOwner;
- import java.awt.datatransfer.StringSelection;
- import java.awt.datatransfer.Transferable;
-
- public class WClipboard extends Clipboard {
- public WClipboard() {
- super("System");
- }
-
- public synchronized void setContents(Transferable var1, ClipboardOwner var2) {
- if (super.owner != null && super.owner != var2) {
- super.owner.lostOwnership(this, super.contents);
- }
-
- super.owner = var2;
- super.contents = var1;
- if (var1 instanceof StringSelection) {
- this.setClipboardText((StringSelection)var1);
- }
-
- }
-
- public synchronized Transferable getContents(Object var1) {
- String var2 = this.getClipboardText();
- return var2 == null ? null : new StringSelection(var2);
- }
-
- public synchronized void lostSelectionOwnership() {
- if (super.owner != null) {
- super.owner.lostOwnership(this, super.contents);
- super.owner = null;
- super.contents = null;
- }
-
- }
-
- private static native void init();
-
- private native void setClipboardText(StringSelection var1);
-
- private native String getClipboardText();
-
- static {
- init();
- }
- }
-