Top Description Fields Constructors Methods
com.sun.javafx.embed.swing

public Class CachingTransferable

extends Object
implements Transferable
Class Inheritance
All Implemented Interfaces
java.awt.datatransfer.Transferable
Known Direct Subclasses
com.sun.javafx.embed.swing.SwingDragSource
Imports
java.awt.datatransfer.DataFlavor, .Transferable, java.io.UnsupportedEncodingException, java.util.Arrays, .Collections, .HashMap, .Map, javafx.scene.input.Clipboard, .DataFormat

A Transferable implementation backed by a Map. The data can be populated either from AWT Transferable or from FX Clipboard.

Field Summary

Modifier and TypeField and Description
private Map<String, Object>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Object
getData(final String mimeType)

public String[]
public Object
getTransferData(final DataFlavor
the requested flavor for the data
flavor
)

Implements java.awt.datatransfer.Transferable.getTransferData.

Returns an object which represents the data to be transferred.

public DataFlavor[]
getTransferDataFlavors()

Implements java.awt.datatransfer.Transferable.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).

public boolean
isDataFlavorSupported(final DataFlavor
the requested flavor for the data
flavor
)

Implements java.awt.datatransfer.Transferable.isDataFlavorSupported.

Returns whether or not the specified data flavor is supported for this object.

public boolean
isMimeTypeAvailable(final String mimeType)

public void
updateData(Transferable t, boolean fetchData)

public void
updateData(Clipboard cb, boolean fetchData)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

mimeType2Databack to summary
private Map<String, Object> mimeType2Data

Constructor Detail

CachingTransferableback to summary
public CachingTransferable()

Method Detail

getDataback to summary
public Object getData(final String mimeType)
getMimeTypesback to summary
public String[] getMimeTypes()
getTransferDataback to summary
public Object getTransferData(final DataFlavor flavor) throws UnsupportedEncodingException

Implements java.awt.datatransfer.Transferable.getTransferData.

Doc from java.awt.datatransfer.Transferable.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.

Parameters
flavor:DataFlavor

the requested flavor for the data

Returns:Object

an object which represents the data to be transferred

Annotations
@Override
getTransferDataFlavorsback to summary
public DataFlavor[] getTransferDataFlavors()

Implements java.awt.datatransfer.Transferable.getTransferDataFlavors.

Doc from java.awt.datatransfer.Transferable.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).

Returns:DataFlavor[]

an array of data flavors in which this data can be transferred

Annotations
@Override
isDataFlavorSupportedback to summary
public boolean isDataFlavorSupported(final DataFlavor flavor)

Implements java.awt.datatransfer.Transferable.isDataFlavorSupported.

Doc from java.awt.datatransfer.Transferable.isDataFlavorSupported.

Returns whether or not the specified data flavor is supported for this object.

Parameters
flavor:DataFlavor

the requested flavor for the data

Returns:boolean

boolean indicating whether or not the data flavor is supported

Annotations
@Override
isMimeTypeAvailableback to summary
public boolean isMimeTypeAvailable(final String mimeType)
updateDataback to summary
public void updateData(Transferable t, boolean fetchData)
updateDataback to summary
public void updateData(Clipboard cb, boolean fetchData)