home *** CD-ROM | disk | FTP | other *** search
- package sun.awt.motif;
-
- import java.awt.datatransfer.Clipboard;
- import java.awt.datatransfer.ClipboardOwner;
- import java.awt.datatransfer.Transferable;
-
- public class X11Clipboard extends Clipboard implements X11SelectionHolder {
- private X11Selection clipboardSelection = new X11Selection("CLIPBOARD");
-
- public X11Clipboard(String var1) {
- super(var1);
- super.contents = this.clipboardSelection;
- }
-
- public synchronized void setContents(Transferable var1, ClipboardOwner var2) {
- if (super.owner != null) {
- super.owner.lostOwnership(this, super.contents);
- }
-
- if (this.clipboardSelection.getSelectionOwnership(var1, this)) {
- super.owner = var2;
- super.contents = var1;
- } else {
- super.owner = null;
- super.contents = this.clipboardSelection;
- }
- }
-
- public synchronized Transferable getContents(Object var1) {
- return super.contents;
- }
-
- public synchronized void lostSelectionOwnership() {
- if (super.owner != null) {
- super.owner.lostOwnership(this, super.contents);
- super.owner = null;
- super.contents = this.clipboardSelection;
- }
-
- }
- }
-