com.mindprod.common11
Class ClipboardPoker

java.lang.Object
  extended by com.mindprod.common11.ClipboardPoker

public final class ClipboardPoker
extends java.lang.Object

Lets us get and put the contents of the clipboard.

This class should never even be loaded if we are running as an Applet. Users of this class must: import java.awt.datatransfer.*; and implement java.awt.datatransfer.ClipboardOwner with at least a dummy lostOwnership method.

Since:
1999
Version:
2.4 2011-01-04 move to common11. share by ISBN, Quoter. SecurityManager check
Author:
Roedy Green, Canadian Mind Products

Constructor Summary
ClipboardPoker()
           
 
Method Summary
static java.lang.String getClip(java.awt.Component owner)
          get current contents of the Clipboard as a String.
static void setClip(java.lang.String s, java.awt.Component owner)
          Copy data into the Clipboard.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClipboardPoker

public ClipboardPoker()
Method Detail

getClip

public static java.lang.String getClip(java.awt.Component owner)
get current contents of the Clipboard as a String. Returns null if any trouble, or if clip is empty. Not legal in un UNSIGNED Applet.

Parameters:
owner - this Applet containing the clipboard.
Returns:
String contents of the clipboard, null if anything goes wrong.

setClip

public static void setClip(java.lang.String s,
                           java.awt.Component owner)
Copy data into the Clipboard. We become its owner until somebody else changes the value.

Parameters:
s - new contents of clipboard, may be null or "". Not legal in an unsigned Applet.
owner - this Applet containing the clipboard.