org.tentackle.util
Class FileTransferable

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.Vector<File>
              extended by org.tentackle.util.FileTransferable
All Implemented Interfaces:
Transferable, Serializable, Cloneable, Iterable<File>, Collection<File>, List<File>, RandomAccess

public class FileTransferable
extends Vector<File>
implements Transferable

A transferable for files.
Returned to the drop target (if we are the drag source) and if the dragged object is a document (either File or Directory).

See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.Vector
capacityIncrement, elementCount, elementData
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
FileTransferable(File file)
          Creates a FileTransferable.
 
Method Summary
 Object getTransferData(DataFlavor flavor)
          Returns an object which represents the data to be transferred.
 DataFlavor[] getTransferDataFlavors()
          Returns an array of DataFlavor objects indicating the flavors the data can be provided in.
 boolean isDataFlavorSupported(DataFlavor flavor)
          Returns whether or not the specified data flavor is supported for this object.
 
Methods inherited from class java.util.Vector
add, add, addAll, addAll, addElement, capacity, clear, clone, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, get, hashCode, indexOf, indexOf, insertElementAt, isEmpty, lastElement, lastIndexOf, lastIndexOf, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, removeRange, retainAll, set, setElementAt, setSize, size, subList, toArray, toArray, toString, trimToSize
 
Methods inherited from class java.util.AbstractList
iterator, listIterator, listIterator
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
iterator, listIterator, listIterator
 

Constructor Detail

FileTransferable

public FileTransferable(File file)
Creates a FileTransferable.

Parameters:
file - the file
Method Detail

getTransferDataFlavors

public DataFlavor[] getTransferDataFlavors()
Description copied from interface: java.awt.datatransfer.Transferable
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).

Specified by:
getTransferDataFlavors in interface Transferable
Returns:
an array of data flavors in which this data can be transferred

isDataFlavorSupported

public boolean isDataFlavorSupported(DataFlavor flavor)
Description copied from interface: java.awt.datatransfer.Transferable
Returns whether or not the specified data flavor is supported for this object.

Specified by:
isDataFlavorSupported in interface Transferable
Parameters:
flavor - the requested flavor for the data
Returns:
boolean indicating whether or not the data flavor is supported

getTransferData

public Object getTransferData(DataFlavor flavor)
                       throws UnsupportedFlavorException,
                              IOException
Description copied from interface: java.awt.datatransfer.Transferable
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.

Specified by:
getTransferData in interface Transferable
Parameters:
flavor - the requested flavor for the data
Throws:
UnsupportedFlavorException - if the requested data flavor is not supported.
IOException - if the data is no longer available in the requested flavor.
See Also:
DataFlavor.getRepresentationClass()


Copyright © 2001-2008 Harald Krake, Bergstr. 48, 78098 Triberg, Germany, harald@krake.de