org.jhotdraw.gui.datatransfer
Class ClipboardUtil

java.lang.Object
  extended by org.jhotdraw.gui.datatransfer.ClipboardUtil

public class ClipboardUtil
extends java.lang.Object

ClipboardUtil provides utility methods for the Java Clipboard API.

Version:
$Id: ClipboardUtil.java 574 2009-10-14 21:38:03Z rawcoder $
Author:
Werner Randelshofer

Field Summary
private static java.awt.datatransfer.Clipboard instance
          Holds the clipboard service instance.
 
Constructor Summary
ClipboardUtil()
           
 
Method Summary
static java.awt.datatransfer.Clipboard getClipboard()
          Returns the ClipboardService instance.
static void setClipboard(java.awt.datatransfer.Clipboard instance)
          Sets the Clipboard singleton used by the JHotDraw framework.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

instance

private static java.awt.datatransfer.Clipboard instance
Holds the clipboard service instance.

Constructor Detail

ClipboardUtil

public ClipboardUtil()
Method Detail

getClipboard

public static java.awt.datatransfer.Clipboard getClipboard()
Returns the ClipboardService instance. If none is set, creates a new one which tries to access the system clipboard. If this fails, an instance with a JVM local clipboard is created.

Returns:
system clipboard or a proxy.

setClipboard

public static void setClipboard(java.awt.datatransfer.Clipboard instance)
Sets the Clipboard singleton used by the JHotDraw framework.

If you set this null, the next call to getClipboard will create a new singleton.