public class BasicTransferable extends Object implements Transferable, UIResource
Modifier and Type | Field and Description |
---|---|
protected String |
htmlData |
private static DataFlavor[] |
htmlFlavors |
protected String |
plainData |
private static DataFlavor[] |
plainFlavors |
private static DataFlavor[] |
stringFlavors |
Constructor and Description |
---|
BasicTransferable(String plainData,
String htmlData) |
Modifier and Type | Method and Description |
---|---|
protected String |
getHTMLData()
Fetch the data in a text/html format
|
protected String |
getPlainData()
Fetch the data in a text/plain format.
|
protected Object |
getRicherData(DataFlavor flavor) |
protected DataFlavor[] |
getRicherFlavors()
Some subclasses will have flavors that are more descriptive than HTML
or plain text.
|
Object |
getTransferData(DataFlavor flavor)
Returns an object which represents the data to be transferred.
|
DataFlavor[] |
getTransferDataFlavors()
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 |
isHTMLSupported()
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 |
isPlainSupported()
Should the plain text flavors be offered?
|
protected boolean |
isRicherFlavor(DataFlavor flavor) |
protected boolean |
isStringFlavor(DataFlavor flavor)
Returns whether or not the specified data flavor is a String flavor that
is supported.
|
private static DataFlavor[] htmlFlavors
private static DataFlavor[] stringFlavors
private static DataFlavor[] plainFlavors
public BasicTransferable(String plainData, String htmlData)
public DataFlavor[] getTransferDataFlavors()
getTransferDataFlavors
in interface Transferable
public boolean isDataFlavorSupported(DataFlavor flavor)
isDataFlavorSupported
in interface Transferable
flavor
- the requested flavor for the datapublic Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException, IOException
getTransferData
in interface Transferable
flavor
- the requested flavor for the dataIOException
- if the data is no longer available
in the requested flavor.UnsupportedFlavorException
- if the requested data flavor is
not supported.DataFlavor.getRepresentationClass()
protected boolean isRicherFlavor(DataFlavor flavor)
protected DataFlavor[] getRicherFlavors()
protected Object getRicherData(DataFlavor flavor) throws UnsupportedFlavorException
UnsupportedFlavorException
protected boolean isHTMLFlavor(DataFlavor flavor)
flavor
- the requested flavor for the dataprotected boolean isHTMLSupported()
protected String getHTMLData()
protected boolean isPlainFlavor(DataFlavor flavor)
flavor
- the requested flavor for the dataprotected boolean isPlainSupported()
protected String getPlainData()
protected boolean isStringFlavor(DataFlavor flavor)
flavor
- the requested flavor for the dataWebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses