|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.mucommander.ui.dnd.TransferableFileSet
public class TransferableFileSet
This class represents a Transferable file set and is used for Drag and Drop transfers initiated by muCommander (dragged from a muCommander UI component).
The actual file set data can be fetched using one of those 3 DataFlavors :
getFileSetDataFlavor()): data returned as a FileSet.
This flavor is used for local file transfers (within the application) only. In particular, this DataFlavor cannot
be used to transfer data to the clipboard because the data (FileSet) cannot be serialized.
In this case, the setFileSetDataFlavorSupported(boolean) method should be used to disable FileSet DataFlavor.
java.io.File files.
This flavor is used for file transfers to and from external applications.
| Constructor Summary | |
|---|---|
TransferableFileSet(FileSet fileSet)
Creates a new Transferable file set with support for all DataFlavors enabled. |
|
| Method Summary | |
|---|---|
static java.awt.datatransfer.DataFlavor |
getFileSetDataFlavor()
Returns an instance of the custom FileSet DataFlavor used to transfer files locally. |
boolean |
getStringDataFlavourTransfersFilename()
Returns whether the files' full path or just the filenames will be returned when getTransferData(java.awt.datatransfer.DataFlavor) is called with DataFlavor.stringFlavor. |
java.lang.Object |
getTransferData(java.awt.datatransfer.DataFlavor dataFlavor)
|
java.awt.datatransfer.DataFlavor[] |
getTransferDataFlavors()
|
static FileSet |
getTransferFiles(java.awt.datatransfer.Transferable transferable)
Returns the files contained by the specified Transferable as a FileSet,
or null if no file was present in the Transferable or if an error occurred. |
boolean |
isDataFlavorSupported(java.awt.datatransfer.DataFlavor dataFlavor)
|
void |
setFileSetDataFlavorSupported(boolean supported)
Sets whether or not the FileSet DataFlavor (as returned by getFileSetDataFlavor()
should be supported by this Transferable (supported by default). |
void |
setJavaFileListDataFlavorSupported(boolean supported)
Sets whether or not the DataFlavor.javaFileListFlavor should be supported by this Transferable
(supported by default). |
void |
setStringDataFlavorSupported(boolean supported)
Sets whether or not the DataFlavor.stringFlavor should be supported by this Transferable
(supported by default). |
void |
setStringDataFlavourTransfersFilename(boolean b)
Sets whether the files' full path or just the filenames should be returned when getTransferData(java.awt.datatransfer.DataFlavor) is called with DataFlavor.stringFlavor. |
void |
setTextUriFlavorSupported(boolean supported)
Sets whether or not the text/uri-list (RFC 2483) should be supported by this Transferable
(supported by default). |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TransferableFileSet(FileSet fileSet)
fileSet - the files to be transferred| Method Detail |
|---|
public void setFileSetDataFlavorSupported(boolean supported)
DataFlavor (as returned by getFileSetDataFlavor()
should be supported by this Transferable (supported by default).
supported - true to support the flavorpublic void setJavaFileListDataFlavorSupported(boolean supported)
DataFlavor.javaFileListFlavor should be supported by this Transferable
(supported by default).
supported - true to support the flavorpublic void setStringDataFlavorSupported(boolean supported)
DataFlavor.stringFlavor should be supported by this Transferable
(supported by default).
supported - true to support the flavorpublic void setTextUriFlavorSupported(boolean supported)
text/uri-list (RFC 2483) should be supported by this Transferable
(supported by default).
supported - true to support the flavorpublic void setStringDataFlavourTransfersFilename(boolean b)
getTransferData(java.awt.datatransfer.DataFlavor) is called with DataFlavor.stringFlavor.
(*not* enabled by default)
b - if true, DataFlavor.stringFlavor returns filenames only, full file paths otherwise.public boolean getStringDataFlavourTransfersFilename()
getTransferData(java.awt.datatransfer.DataFlavor) is called with DataFlavor.stringFlavor.
Returns false unless setStringDataFlavourTransfersFilename(boolean) has been called.
getTransferData(java.awt.datatransfer.DataFlavor) is called with DataFlavor.stringFlavorpublic static java.awt.datatransfer.DataFlavor getFileSetDataFlavor()
public static FileSet getTransferFiles(java.awt.datatransfer.Transferable transferable)
FileSet,
or null if no file was present in the Transferable or if an error occurred.
3 types of dropped data flavors are supported and used in this order of priority:
transferable - a Transferable instance that contains the files to be retrieved
null if no file
was present or if an error occurredpublic java.awt.datatransfer.DataFlavor[] getTransferDataFlavors()
getTransferDataFlavors in interface java.awt.datatransfer.Transferablepublic boolean isDataFlavorSupported(java.awt.datatransfer.DataFlavor dataFlavor)
isDataFlavorSupported in interface java.awt.datatransfer.Transferable
public java.lang.Object getTransferData(java.awt.datatransfer.DataFlavor dataFlavor)
throws java.awt.datatransfer.UnsupportedFlavorException,
java.io.IOException
getTransferData in interface java.awt.datatransfer.Transferablejava.awt.datatransfer.UnsupportedFlavorException
java.io.IOException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
This file is part of muCommander - Copyright (C) 2002-2008 Maxence Bernard