Transferable
which implements the capability required to transfer a
String
.
This Transferable
properly supports DataFlavor.stringFlavor
and all equivalent flavors. Support for DataFlavor.plainTextFlavor
and all equivalent flavors is deprecated. No other DataFlavor
s
are supported.
DataFlavor#stringFlavor
, DataFlavor#plainTextFlavor
Modifier and Type | Field and Description |
---|---|
private String | |
private static final DataFlavor[] | |
private static final int | |
private static final int |
Access | Constructor and Description |
---|---|
public | StringSelection(String
the string to be transferred data)Creates a |
Modifier and Type | Method and Description |
---|---|
public Object | Returns: the data in the requested flavor, as outlined abovethe requested flavor for the data flavor)Implements java. Returns the |
public DataFlavor[] | Returns: an array of length two, whose elements areDataFlavor.stringFlavor and
DataFlavor.plainTextFlavor Implements java. Returns an array of flavors in which this |
public boolean | Returns: true if flavor is equal to
DataFlavor.stringFlavor or
DataFlavor.plainTextFlavor ; false if
flavor is not one of the above flavorsthe requested flavor for the data flavor)Implements java. Returns whether the requested flavor is supported by this
|
public void | lostOwnership(Clipboard
the clipboard that is no longer owned clipboard, Transferable the contents which this owner had placed on the
contents)clipboard Implements java. Notifies this object that it is no longer the clipboard owner. |
data | back to summary |
---|---|
private String data |
flavors | back to summary |
---|---|
private static final DataFlavor[] flavors
|
PLAIN_TEXT | back to summary |
---|---|
private static final int PLAIN_TEXT |
STRING | back to summary |
---|---|
private static final int STRING |
StringSelection | back to summary |
---|---|
public StringSelection(String data) Creates a
|
getTransferData | back to summary |
---|---|
public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException, IOException Implements java. Returns the Note The behavior of this method for
|
getTransferDataFlavors | back to summary |
---|---|
public DataFlavor[] getTransferDataFlavors() Implements java. Returns an array of flavors in which this
|
isDataFlavorSupported | back to summary |
---|---|
public boolean isDataFlavorSupported(DataFlavor flavor) Implements java. Returns whether the requested flavor is supported by this
|
lostOwnership | back to summary |
---|---|
public void lostOwnership(Clipboard clipboard, Transferable contents) Implements java. Doc from java. Notifies this object that it is no longer the clipboard owner. This method will be called when another application or another object within this application asserts ownership of the clipboard.
|