home *** CD-ROM | disk | FTP | other *** search
/ Popular Software (Premium Edition) / mycd.iso / INTERNET / NETSCAP4.06 / CP32E406.EXE / nav40.z / java40.jar / sun / awt / motif / X11Clipboard.class (.txt) < prev    next >
Encoding:
Java Class File  |  1998-08-13  |  1.3 KB  |  42 lines

  1. package sun.awt.motif;
  2.  
  3. import java.awt.datatransfer.Clipboard;
  4. import java.awt.datatransfer.ClipboardOwner;
  5. import java.awt.datatransfer.Transferable;
  6.  
  7. public class X11Clipboard extends Clipboard implements X11SelectionHolder {
  8.    private X11Selection clipboardSelection = new X11Selection("CLIPBOARD");
  9.  
  10.    public X11Clipboard(String var1) {
  11.       super(var1);
  12.       super.contents = this.clipboardSelection;
  13.    }
  14.  
  15.    public synchronized void setContents(Transferable var1, ClipboardOwner var2) {
  16.       if (super.owner != null) {
  17.          super.owner.lostOwnership(this, super.contents);
  18.       }
  19.  
  20.       if (this.clipboardSelection.getSelectionOwnership(var1, this)) {
  21.          super.owner = var2;
  22.          super.contents = var1;
  23.       } else {
  24.          super.owner = null;
  25.          super.contents = this.clipboardSelection;
  26.       }
  27.    }
  28.  
  29.    public synchronized Transferable getContents(Object var1) {
  30.       return super.contents;
  31.    }
  32.  
  33.    public synchronized void lostSelectionOwnership() {
  34.       if (super.owner != null) {
  35.          super.owner.lostOwnership(this, super.contents);
  36.          super.owner = null;
  37.          super.contents = this.clipboardSelection;
  38.       }
  39.  
  40.    }
  41. }
  42.