public class FileTextFieldTransferHandler extends TransferHandler
TransferHandler.DropLocation, TransferHandler.TransferSupportCOPY, COPY_OR_MOVE, LINK, MOVE, NONE| Constructor and Description |
|---|
FileTextFieldTransferHandler()
Creates a new instance.
|
FileTextFieldTransferHandler(int fileSelectionMode)
Creates a new instance.
|
FileTextFieldTransferHandler(int fileSelectionMode,
FileFilter filter)
Creates a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
canImport(JComponent comp,
DataFlavor[] transferFlavors) |
protected Transferable |
createTransferable(JComponent comp) |
protected void |
exportDone(JComponent comp,
Transferable data,
int action)
This method is called after data has been exported.
|
FileFilter |
getFileFilter() |
protected DataFlavor |
getImportFlavor(DataFlavor[] flavors,
JTextComponent c)
Try to find a flavor that can be used to import a Transferable.
|
int |
getSourceActions(JComponent comp)
This is the type of transfer actions supported by the source.
|
protected void |
handleReaderImport(Reader in,
JTextComponent c,
boolean useRead)
Import the given stream data into the text component.
|
boolean |
importData(JComponent comp,
Transferable t) |
void |
setFileFilter(FileFilter fileFilter) |
canImport, exportAsDrag, exportToClipboard, getCopyAction, getCutAction, getDragImage, getDragImageOffset, getPasteAction, getVisualRepresentation, importData, setDragImage, setDragImageOffsetpublic FileTextFieldTransferHandler()
public FileTextFieldTransferHandler(int fileSelectionMode)
fileSelectionMode - JFileChooser file selection mode.public FileTextFieldTransferHandler(int fileSelectionMode,
FileFilter filter)
fileSelectionMode - JFileChooser file selection mode.public boolean importData(JComponent comp, Transferable t)
importData in class TransferHandlerprotected Transferable createTransferable(JComponent comp)
createTransferable in class TransferHandlerpublic boolean canImport(JComponent comp, DataFlavor[] transferFlavors)
canImport in class TransferHandlerprotected DataFlavor getImportFlavor(DataFlavor[] flavors, JTextComponent c)
protected void handleReaderImport(Reader in, JTextComponent c, boolean useRead) throws BadLocationException, IOException
BadLocationExceptionIOExceptionpublic int getSourceActions(JComponent comp)
getSourceActions in class TransferHandlercomp - The component holding the data to be transfered. This
argument is provided to enable sharing of TransferHandlers by
multiple components.protected void exportDone(JComponent comp, Transferable data, int action)
exportDone in class TransferHandlercomp - The component that was the source of the data.data - The data that was transferred or possibly null
if the action is NONE.action - The actual action that was performed.public FileFilter getFileFilter()
public void setFileFilter(FileFilter fileFilter)
fileFilter - the fileFilter to setCopyright © 2014. All Rights Reserved.