public class DragAndDrop extends ViewerFeature
processTransferable(java.awt.datatransfer.Transferable)
method called - this method will call the action(java.io.File)
methods for each File or URL specified.
The name of this feature is DragAndDrop
This code is copyright the Big Faceless Organization. You're welcome to use, modify and distribute it in any form in your own projects, provided those projects continue to make use of the Big Faceless PDF library.
Constructor and Description |
---|
DragAndDrop()
Create a new DragAndDrop object
|
Modifier and Type | Method and Description |
---|---|
void |
action(File file)
Process a
File from a Transferable. |
void |
action(URL url)
Process a
URL from a Transferable, which is guaranteed not to be a file URL. |
static boolean |
canImport(DataFlavor flavor)
Return true if the DataFlavor can be processed by this class
|
static boolean |
canImport(DataFlavor[] flavors)
Return true if the DataFlavor can be processed by this class
|
TransferHandler |
getTransferHandler()
Return a
TransferHandler which can be added to a JComponent . |
void |
initialize(PDFViewer viewer)
Called when the feature is first added to a viewer
|
boolean |
processTransferable(Transferable tran)
Process the Transferable object by calling
action(File) or action(URL)
on each matching item being transfered. |
getAllEnabledFeatures, getAllFeatures, getCustomJavaScript, getFeatureProperty, getFeatureURLProperty, getName, isEnabledByDefault, setFeatureName, teardown, toString
public void initialize(PDFViewer viewer)
ViewerFeature
initialize
in class ViewerFeature
public TransferHandler getTransferHandler()
TransferHandler
which can be added to a JComponent
.public static boolean canImport(DataFlavor[] flavors)
public static boolean canImport(DataFlavor flavor)
public boolean processTransferable(Transferable tran)
action(File)
or action(URL)
on each matching item being transfered.public void action(File file)
File
from a Transferable. By default called PDFViewer.loadPDF(File)
public void action(URL url)
Copyright © 2001-2017 Big Faceless Organization