com.notuvy.clip
Class ClipboardAccess

java.lang.Object
  extended by com.notuvy.clip.ClipboardAccess
All Implemented Interfaces:
ClipboardOwner

public abstract class ClipboardAccess
extends Object
implements ClipboardOwner

A utility that provides read/write access to the system Clipboard. Notice that if this is loaded in a headless environment, then a stub implementation is created. This should never be a problem because the only meaningful headless environment where this will be used is the unit test framework. This utility (and the system clipboard) is only meaningful in a graphical environment.

Author:
murali

Field Summary
protected static org.apache.log4j.Logger LOG
           
 
Constructor Summary
ClipboardAccess()
           
 
Method Summary
 void lostOwnership(Clipboard pClipboard, Transferable pTransferable)
           
static void main(String[] args)
           
static String read()
           
abstract  String readText()
           
static void save(String pString)
           
abstract  void saveText(String pString)
           
protected static ValueHolder<String> setDummy()
          For unit tests.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

protected static final org.apache.log4j.Logger LOG
Constructor Detail

ClipboardAccess

public ClipboardAccess()
Method Detail

setDummy

protected static ValueHolder<String> setDummy()
For unit tests.

Returns:
The internal string value holder that the tests can use to simulate system clipboard changes.

read

public static String read()

save

public static void save(String pString)

readText

public abstract String readText()

saveText

public abstract void saveText(String pString)

lostOwnership

public void lostOwnership(Clipboard pClipboard,
                          Transferable pTransferable)
Specified by:
lostOwnership in interface ClipboardOwner

main

public static void main(String[] args)


Copyright © 2013. All Rights Reserved.