com.lightdev.app.filemanager.ui
Class FileRefTransferable

java.lang.Object
  extended by com.lightdev.app.filemanager.ui.FileRefTransferable
All Implemented Interfaces:
Transferable

public class FileRefTransferable
extends Object
implements Transferable

A class that can be used for the transport of object arrays of class FileRef[] in data transfer operations such as cut, copy and paste or drag and drop.

Version:
1, 10.12.2007
Author:
Ulrich Hilger, Light Development, http://www.lightdev.com, info@lightdev.com, published under the terms and conditions of the BSD License, for details see file license.txt in the distribution package of this software

Field Summary
static DataFlavor FileRefArrayFlavor
          the data flavor supported by this Transferable
static DataFlavor FileSystemFlavor
           
 
Constructor Summary
FileRefTransferable(FileRef[] files, FileSystem sourceFs)
          create a new instance of class FileRefTransferable
 
Method Summary
 Object getTransferData(DataFlavor flavor)
          get the data of a given data flavor this instance of FileRefTransferable transports
 DataFlavor[] getTransferDataFlavors()
          get the data flavors supported by this class
 boolean isDataFlavorSupported(DataFlavor flavor)
          determine whether or not a given data flavor is supported by this class
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FileRefArrayFlavor

public static final DataFlavor FileRefArrayFlavor
the data flavor supported by this Transferable


FileSystemFlavor

public static final DataFlavor FileSystemFlavor
Constructor Detail

FileRefTransferable

public FileRefTransferable(FileRef[] files,
                           FileSystem sourceFs)
create a new instance of class FileRefTransferable

Parameters:
files - the array of files to transport with this instance of FileRefTransferable
sourceFs - the source file system
Method Detail

getTransferData

public Object getTransferData(DataFlavor flavor)
                       throws UnsupportedFlavorException,
                              IOException
get the data of a given data flavor this instance of FileRefTransferable transports

Specified by:
getTransferData in interface Transferable
Parameters:
flavor - the requested data flavor
Returns:
the data of the given flavor
Throws:
UnsupportedFlavorException - if the given flavor is not supported
IOException

getTransferDataFlavors

public DataFlavor[] getTransferDataFlavors()
get the data flavors supported by this class

Specified by:
getTransferDataFlavors in interface Transferable
Returns:
the supported data flavors

isDataFlavorSupported

public boolean isDataFlavorSupported(DataFlavor flavor)
determine whether or not a given data flavor is supported by this class

Specified by:
isDataFlavorSupported in interface Transferable
Parameters:
flavor - the requested data flavor
Returns:
true, if the requested data flavor is supported, false if not