public class JavaFileSelection
extends java.lang.Object
implements java.awt.datatransfer.Transferable
Modifier and Type | Field and Description |
---|---|
static java.awt.datatransfer.DataFlavor[] |
FLAVORS
Accepted flavors
|
private java.util.List<java.io.File> |
listFile
File list carry
|
Constructor and Description |
---|
JavaFileSelection(java.io.File... files)
Constructs JavaFileSelection
|
JavaFileSelection(java.util.List<java.io.File> listFile)
Constructs JavaFileSelection
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
getTransferData(java.awt.datatransfer.DataFlavor flavor)
Return the data associated to a flavor type
|
java.awt.datatransfer.DataFlavor[] |
getTransferDataFlavors()
Supported flavor list
|
boolean |
isDataFlavorSupported(java.awt.datatransfer.DataFlavor flavor)
Indicates if flavor is supported
|
public static final java.awt.datatransfer.DataFlavor[] FLAVORS
private final java.util.List<java.io.File> listFile
public JavaFileSelection(java.io.File... files)
files
- List of filespublic JavaFileSelection(java.util.List<java.io.File> listFile)
listFile
- List filepublic 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
- Flavor typejava.awt.datatransfer.UnsupportedFlavorException
- If flavor is not DataFlavor.javaFileListFlavor
java.io.IOException
- On IO issueTransferable.getTransferData(java.awt.datatransfer.DataFlavor)
public java.awt.datatransfer.DataFlavor[] getTransferDataFlavors()
getTransferDataFlavors
in interface java.awt.datatransfer.Transferable
Transferable.getTransferDataFlavors()
public boolean isDataFlavorSupported(java.awt.datatransfer.DataFlavor flavor)
isDataFlavorSupported
in interface java.awt.datatransfer.Transferable
flavor
- Tested flavortrue
if flavor supportedTransferable.isDataFlavorSupported(java.awt.datatransfer.DataFlavor)