public class TableTransferable
extends java.lang.Object
implements java.awt.datatransfer.Transferable
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
htmlData |
protected java.lang.String |
plainData |
Constructor and Description |
---|
TableTransferable(java.lang.String plainData,
java.lang.String htmlData) |
Modifier and Type | Method and Description |
---|---|
protected java.lang.String |
getHTMLData()
Fetch the data in a text/html format
|
protected java.lang.String |
getPlainData()
Fetch the data in a text/plain format.
|
protected java.lang.Object |
getRicherData(java.awt.datatransfer.DataFlavor flavor) |
protected java.awt.datatransfer.DataFlavor[] |
getRicherFlavors()
Some subclasses will have flavors that are more descriptive than HTML
or plain text.
|
java.lang.Object |
getTransferData(java.awt.datatransfer.DataFlavor flavor)
Returns an object which represents the data to be transferred.
|
java.awt.datatransfer.DataFlavor[] |
getTransferDataFlavors()
Returns an array of DataFlavor objects indicating the flavors the data
can be provided in.
|
boolean |
isDataFlavorSupported(java.awt.datatransfer.DataFlavor flavor)
Returns whether or not the specified data flavor is supported for
this object.
|
protected boolean |
isHTMLFlavor(java.awt.datatransfer.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? If so, the method
getHTMLData should be implemented to provide something reasonable.
|
protected boolean |
isPlainFlavor(java.awt.datatransfer.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? If so, the method
getPlainData should be implemented to provide something reasonable.
|
protected boolean |
isRicherFlavor(java.awt.datatransfer.DataFlavor flavor) |
protected boolean |
isStringFlavor(java.awt.datatransfer.DataFlavor flavor)
Returns whether or not the specified data flavor is a String flavor that
is supported.
|
protected java.lang.String plainData
protected java.lang.String htmlData
public TableTransferable(java.lang.String plainData, java.lang.String htmlData)
public java.awt.datatransfer.DataFlavor[] getTransferDataFlavors()
getTransferDataFlavors
in interface java.awt.datatransfer.Transferable
public boolean isDataFlavorSupported(java.awt.datatransfer.DataFlavor flavor)
isDataFlavorSupported
in interface java.awt.datatransfer.Transferable
flavor
- the requested flavor for the datapublic java.lang.Object getTransferData(java.awt.datatransfer.DataFlavor flavor) throws java.awt.datatransfer.UnsupportedFlavorException, java.io.IOException
getTransferData
in interface java.awt.datatransfer.Transferable
flavor
- the requested flavor for the datajava.io.IOException
- if the data is no longer available
in the requested flavor.java.awt.datatransfer.UnsupportedFlavorException
- if the requested data flavor is
not supported.DataFlavor.getRepresentationClass()
protected boolean isRicherFlavor(java.awt.datatransfer.DataFlavor flavor)
protected java.awt.datatransfer.DataFlavor[] getRicherFlavors()
protected java.lang.Object getRicherData(java.awt.datatransfer.DataFlavor flavor) throws java.awt.datatransfer.UnsupportedFlavorException
java.awt.datatransfer.UnsupportedFlavorException
protected boolean isHTMLFlavor(java.awt.datatransfer.DataFlavor flavor)
flavor
- the requested flavor for the dataprotected boolean isHTMLSupported()
protected java.lang.String getHTMLData()
protected boolean isPlainFlavor(java.awt.datatransfer.DataFlavor flavor)
flavor
- the requested flavor for the dataprotected boolean isPlainSupported()
protected java.lang.String getPlainData()
protected boolean isStringFlavor(java.awt.datatransfer.DataFlavor flavor)
flavor
- the requested flavor for the data