Class BasicTransferable
java.lang.Object
org.jdesktop.swingx.plaf.basic.core.BasicTransferable
- All Implemented Interfaces:
Transferable
,UIResource
A transferable implementation for the default data transfer of some Swing
components.
- Version:
- 1.10 11/17/05
- Author:
- Timothy Prinzing
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected String
Fetch the data in a text/html formatprotected String
Fetch the data in a text/plain format.protected Object
getRicherData
(DataFlavor flavor) TODOprotected DataFlavor[]
Some subclasses will have flavors that are more descriptive than HTML or plain text.getTransferData
(DataFlavor flavor) Returns an object which represents the data to be transferred.Returns an array of DataFlavor objects indicating the flavors the data can be provided in.boolean
isDataFlavorSupported
(DataFlavor flavor) Returns whether or not the specified data flavor is supported for this object.protected boolean
isHTMLFlavor
(DataFlavor flavor) Returns whether or not the specified data flavor is an HTML flavor that is supported.protected boolean
Should the HTML flavors be offered?protected boolean
isPlainFlavor
(DataFlavor flavor) Returns whether or not the specified data flavor is an plain flavor that is supported.protected boolean
Should the plain text flavors be offered?protected boolean
isRicherFlavor
(DataFlavor flavor) TODO docprotected boolean
isStringFlavor
(DataFlavor flavor) Returns whether or not the specified data flavor is a String flavor that is supported.
-
Field Details
-
plainData
-
htmlData
-
-
Constructor Details
-
BasicTransferable
ctor- Parameters:
plainData
- StringhtmlData
- String
-
-
Method Details
-
getTransferDataFlavors
Returns an array of DataFlavor objects indicating the flavors the data can be provided in. The array should be ordered according to preference for providing the data (from most richly descriptive to least descriptive).- Specified by:
getTransferDataFlavors
in interfaceTransferable
- Returns:
- an array of data flavors in which this data can be transferred
-
isDataFlavorSupported
Returns whether or not the specified data flavor is supported for this object.- Specified by:
isDataFlavorSupported
in interfaceTransferable
- Parameters:
flavor
- the requested flavor for the data- Returns:
- boolean indicating whether or not the data flavor is supported
-
getTransferData
Returns an object which represents the data to be transferred. The class of the object returned is defined by the representation class of the flavor.- Specified by:
getTransferData
in interfaceTransferable
- Parameters:
flavor
- the requested flavor for the data- Throws:
IOException
- if the data is no longer available in the requested flavor.UnsupportedFlavorException
- if the requested data flavor is not supported.- See Also:
-
isRicherFlavor
TODO doc- Parameters:
flavor
- DataFlavor- Returns:
- true if isRicherFlavor
-
getRicherFlavors
Some subclasses will have flavors that are more descriptive than HTML or plain text. If this method returns a non-null value, it will be placed at the start of the array of supported flavors.- Returns:
- null
-
getRicherData
TODO- Parameters:
flavor
- DataFlavor- Returns:
- null
- Throws:
UnsupportedFlavorException
- TODO doc
-
isHTMLFlavor
Returns whether or not the specified data flavor is an HTML flavor that is supported.- Parameters:
flavor
- the requested flavor for the data- Returns:
- boolean indicating whether or not the data flavor is supported
-
isHTMLSupported
protected boolean isHTMLSupported()Should the HTML flavors be offered? If so, the method getHTMLData should be implemented to provide something reasonable.- Returns:
- there are plainData
-
getHTMLData
Fetch the data in a text/html format- Returns:
- htmlData
-
isPlainFlavor
Returns whether or not the specified data flavor is an plain flavor that is supported.- Parameters:
flavor
- the requested flavor for the data- Returns:
- boolean indicating whether or not the data flavor is supported
-
isPlainSupported
protected boolean isPlainSupported()Should the plain text flavors be offered? If so, the method getPlainData should be implemented to provide something reasonable.- Returns:
- there are plainData
-
getPlainData
Fetch the data in a text/plain format.- Returns:
- plainData
-
isStringFlavor
Returns whether or not the specified data flavor is a String flavor that is supported.- Parameters:
flavor
- the requested flavor for the data- Returns:
- boolean indicating whether or not the data flavor is supported
-