webfunds.utils
Class ClipboardHelper

java.lang.Object
  |
  +--webfunds.utils.ClipboardHelper

public final class ClipboardHelper
extends java.lang.Object

Helper class for Java Clipboard related functionality. The Java clipboard implementation always expects LF line endings and blindly adds extra CRs on Windows, even when the text already has CR/LF line endings. This class helps convert text in a platform encoding to text with UNIX line endings so that the Clipboard can then reconvert to platform line endings. Thanks Sun!


Constructor Summary
ClipboardHelper()
           
 
Method Summary
static void main(java.lang.String[] argv)
           
static void setClipboardText(java.lang.String text)
          Put the given text (which must have platform line endings!) on the clipboard.
static java.lang.String toClipboardableText(java.lang.String text)
          Convert the given text from platform line endings to clipboard compatible line endings.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClipboardHelper

public ClipboardHelper()
Method Detail

setClipboardText

public static void setClipboardText(java.lang.String text)
Put the given text (which must have platform line endings!) on the clipboard.

toClipboardableText

public static java.lang.String toClipboardableText(java.lang.String text)
Convert the given text from platform line endings to clipboard compatible line endings. Currently only CR, LF and CR/LF are handled correctly and mixed line endings are not detected.

main

public static void main(java.lang.String[] argv)