Class java.awt.datatransfer.StringSelection
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class java.awt.datatransfer.StringSelection

Object
   |
   +----java.awt.datatransfer.StringSelection

public class StringSelection
extends Object
implements Transferable, ClipboardOwner
A class which implements the capability required to transfer a simple java String in plain text format.


Constructor Index

 o java.awt.datatransfer.StringSelection(String)
Creates a transferable object capable of transferring the specified string in plain text format.

Method Index

 o getTransferData(DataFlavor)
If the data was requested in the "java.lang.String" flavor, return the String representing the selection.
 o getTransferDataFlavors()
Returns the array of flavors in which it can provide the data.
 o isDataFlavorSupported(DataFlavor)
Returns whether the requested flavor is supported by this object.
 o lostOwnership(Clipboard, Transferable)

Constructors

 o StringSelection
public StringSelection(String data)
Creates a transferable object capable of transferring the specified string in plain text format.

Methods

 o getTransferData
public synchronized java.lang.Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException, IOException
If the data was requested in the "java.lang.String" flavor, return the String representing the selection.

Parameters:
flavor - the requested flavor for the data
Throws: UnsupportedFlavorException
if the requested data flavor is not supported in the "java.lang.String" flavor.
 o getTransferDataFlavors
public synchronized java.awt.datatransfer.DataFlavor[] getTransferDataFlavors()
Returns the array of flavors in which it can provide the data.

 o isDataFlavorSupported
public boolean isDataFlavorSupported(DataFlavor flavor)
Returns whether the requested flavor is supported by this object.

Parameters:
flavor - the requested flavor for the data
 o lostOwnership
public void lostOwnership(Clipboard clipboard,
                          Transferable contents)

All Packages  Class Hierarchy  This Package  Previous  Next  Index