Package net.sf.colossus.util
Class ClipBoardAccess
java.lang.Object
net.sf.colossus.util.ClipBoardAccess
- All Implemented Interfaces:
ClipboardOwner
Little helper class to copy some text (e.g. an error message
or exception ;-) to the system's clipboard.
Copied with some modifications from:
http://www.javapractices.com/topic/TopicAction.do?Id=82
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the String residing on the clipboard.void
lostOwnership
(Clipboard aClipboard, Transferable aContents) Empty implementation of the ClipboardOwner interface.static void
void
setClipboardContents
(String text) Place a String on the clipboard, and make this class the owner of the Clipboard's contents.
-
Constructor Details
-
ClipBoardAccess
public ClipBoardAccess()
-
-
Method Details
-
main
-
lostOwnership
Empty implementation of the ClipboardOwner interface.- Specified by:
lostOwnership
in interfaceClipboardOwner
-
setClipboardContents
Place a String on the clipboard, and make this class the owner of the Clipboard's contents. -
getClipboardContents
Get the String residing on the clipboard.- Returns:
- any text found on the Clipboard; if none found, return an empty String.
-