Mp3dings 
20100427

net.sourceforge.mp3dings.datatransfer
Class TransferData

java.lang.Object
  extended by java.awt.datatransfer.StringSelection
      extended by net.sourceforge.mp3dings.datatransfer.TransferData
All Implemented Interfaces:
ClipboardOwner, Transferable

public class TransferData
extends StringSelection

A Transferable that wraps plain text and html data for the clipboard.*

Author:
ringler

Field Summary
protected static DataFlavor HTML0
           
protected static DataFlavor HTML1
           
protected static DataFlavor OBJECT
          Description of the Field
protected static DataFlavor URI_FILE_LIST
           
 
Constructor Summary
TransferData(Object obj, String plaintext, String markup, File[] files)
          Constructs a new TransferData.
 
Method Summary
static DataFlavor[] getDefaultFlavors()
           
 Object getTransferData(DataFlavor df)
          Gets the transferData attribute of the TransferData object.
 DataFlavor[] getTransferDataFlavors()
          Gets the supported DataFlavors.
 boolean isDataFlavorSupported(DataFlavor flavor)
          Gets the dataFlavorSupported attribute of the TransferData object
 
Methods inherited from class java.awt.datatransfer.StringSelection
lostOwnership
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HTML0

protected static DataFlavor HTML0

HTML1

protected static DataFlavor HTML1

URI_FILE_LIST

protected static DataFlavor URI_FILE_LIST

OBJECT

protected static DataFlavor OBJECT
Description of the Field

Constructor Detail

TransferData

public TransferData(Object obj,
                    String plaintext,
                    String markup,
                    File[] files)
Constructs a new TransferData. If one of the parameters is null the corresponding DataFlavor will not be supported by this Transferable.

Parameters:
obj - Description of the Parameter
plaintext - Description of the Parameter
markup - Description of the Parameter
files - Description of the Parameter
Method Detail

getTransferData

public Object getTransferData(DataFlavor df)
                       throws UnsupportedFlavorException,
                              IOException
Gets the transferData attribute of the TransferData object. Guaranteed not to return null.

Specified by:
getTransferData in interface Transferable
Overrides:
getTransferData in class StringSelection
Parameters:
df - Description of the Parameter
Returns:
The transferData value
Throws:
UnsupportedFlavorException - Description of the Exception
IOException - Description of the Exception

getTransferDataFlavors

public DataFlavor[] getTransferDataFlavors()
Gets the supported DataFlavors.

Specified by:
getTransferDataFlavors in interface Transferable
Overrides:
getTransferDataFlavors in class StringSelection
Returns:
The transferDataFlavors value

getDefaultFlavors

public static DataFlavor[] getDefaultFlavors()

isDataFlavorSupported

public boolean isDataFlavorSupported(DataFlavor flavor)
Gets the dataFlavorSupported attribute of the TransferData object

Specified by:
isDataFlavorSupported in interface Transferable
Overrides:
isDataFlavorSupported in class StringSelection
Parameters:
flavor - Description of the Parameter
Returns:
The dataFlavorSupported value

Mp3dings 
20100427