ecologylab.generic
Class DataTransferTools

java.lang.Object
  extended by ecologylab.generic.Debug
      extended by ecologylab.generic.DataTransferTools

public class DataTransferTools
extends Debug

Help for working with Sun's attrocious drag and drop and clipboard "support".

Author:
andruid

Constructor Summary
DataTransferTools()
           
 
Method Summary
static byte[] convertToMSCfHtml(java.lang.String html)
          surrounds the html with this envelope, ready for windows clipboard (jdk support can be made better)
 
Methods inherited from class ecologylab.generic.Debug
classSimpleName, closeLoggingFile, debug, debug, debug, debug, debugA, debugA, debugA, debugI, debugI, debugI, error, error, getClassName, getClassName, getInteractive, getPackageName, getPackageName, getPackageName, initialize, level, level, level, logToFile, print, print, println, println, println, println, println, println, printlnA, printlnA, printlnA, printlnI, printlnI, printlnI, printlnI, setLoggingFile, show, show, superString, toggleInteractive, toString, toString, warning, warning, weird, weird
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DataTransferTools

public DataTransferTools()
Method Detail

convertToMSCfHtml

public static byte[] convertToMSCfHtml(java.lang.String html)
                                throws java.io.UnsupportedEncodingException
surrounds the html with this envelope, ready for windows clipboard (jdk support can be made better)
 Version:1.0
 StartHTML:00000000000
 EndHTML:00000000000
 StartFragment:00000000000
 EndFragment:00000000000
 <!--StartFragment-->
 ...
 <!-- EndFragment-- >
 
We have to return a byte array 'cause in Windows the html needs to be utf-8 encoded. And because we have to calculate char-offsets, we encode it here.

Parameters:
html -
Returns:
byte[]
Throws:
java.io.UnsupportedEncodingException