| |
|
| java.lang.Object java.awt.datatransfer.StringSelection
Constructor Summary | |
public | StringSelection(String data) Creates a Transferable capable of transferring
the specified String . |
StringSelection | public StringSelection(String data)(Code) | | Creates a Transferable capable of transferring
the specified String .
|
getTransferData | public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException, IOException(Code) | | Returns the Transferable 's data in the requested
DataFlavor if possible. If the desired flavor is
DataFlavor.stringFlavor , or an equivalent flavor,
the String representing the selection is
returned. If the desired flavor is
DataFlavor.plainTextFlavor ,
or an equivalent flavor, a Reader is returned.
Note: The behavior of this method for
DataFlavor.plainTextFlavor
and equivalent DataFlavor s is inconsistent with the
definition of DataFlavor.plainTextFlavor .
Parameters: flavor - the requested flavor for the data the data in the requested flavor, as outlined above throws: UnsupportedFlavorException - if the requested data flavor isnot equivalent to either DataFlavor.stringFlavor or DataFlavor.plainTextFlavor throws: IOException - if an IOException occurs while retrieving the data.By default, StringSelection never throws this exception, but asubclass may. throws: NullPointerException - if flavor is null See Also: java.io.Reader |
getTransferDataFlavors | public DataFlavor[] getTransferDataFlavors()(Code) | | Returns an array of flavors in which this Transferable
can provide the data. DataFlavor.stringFlavor
is properly supported.
Support for DataFlavor.plainTextFlavor is
deprecated.
an array of length two, whose elements are DataFlavor.stringFlavor and DataFlavor.plainTextFlavor |
isDataFlavorSupported | public boolean isDataFlavorSupported(DataFlavor flavor)(Code) | | Returns whether the requested flavor is supported by this
Transferable .
Parameters: flavor - the requested flavor for the data true if flavor is equal toDataFlavor.stringFlavor orDataFlavor.plainTextFlavor ; false if flavor is not one of the above flavors throws: NullPointerException - if flavor is null |
|
|
|