com.levigo.jadice.swing.thumbnailview.dnd
Class FileImportHandler
java.lang.Object
com.levigo.jadice.swing.thumbnailview.dnd.FileImportHandler
- All Implemented Interfaces:
- ImportHandler
public class FileImportHandler
- extends Object
- implements ImportHandler
An ImportHandler
implementation supporting the import of files residing on a local file
system. The supported DataFlavor
is DataFlavor.javaFileListFlavor
and (on Linux
systems only) the URI list flavor with MIME type text/uri-list.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FileImportHandler
public FileImportHandler()
importData
public boolean importData(Transferable t,
int dropAction,
ImportParameters parameters)
throws UnsupportedFlavorException,
IOException,
JadiceException
- Description copied from interface:
ImportHandler
- Import from the given
Transferable
into the given ViewComponent
.
- Specified by:
importData
in interface ImportHandler
- Parameters:
t
- The Transferable
to importdropAction
- the user drop action
of the
importparameters
- the import parameters containing additional context information
- Returns:
true
if the import succeeded
- Throws:
UnsupportedFlavorException
IOException
JadiceException
isDataFlavorSupported
public boolean isDataFlavorSupported(DataFlavor flavor,
ImportParameters parameters)
- Description copied from interface:
ImportHandler
- Check whether the given
DataFlavor
is supported by this import handler.
- Specified by:
isDataFlavorSupported
in interface ImportHandler
- Parameters:
flavor
- The flavor in which the transfer bundle will be provided when supported.parameters
- the import parameters containing additional context information
- Returns:
true
if the given flavor is supported.
getImportActionForFlavor
public int getImportActionForFlavor(DataFlavor flavor,
ImportParameters parameters)
- Description copied from interface:
ImportHandler
- Returns the accepted DnD action for the given
DataFlavor
by this import handler.
- Specified by:
getImportActionForFlavor
in interface ImportHandler
- Parameters:
flavor
- The flavor in which the transfer bundle will be provided when supported.parameters
- the import parameters containing additional context information
- Returns:
int
one of the DnDConstants
action constants. Returns which DnD
action will be accepted by this import handler for the given flavor. If the flavor is
not supported DnDConstants.ACTION_NONE
will be returned.- See Also:
ImportHandler.getImportActionForFlavor(java.awt.datatransfer.DataFlavor,
ImportParameters)
textURIListToFileList
protected static List<File> textURIListToFileList(String data)