1package org.feistymeow.dragdrop;
3import java.awt.datatransfer.DataFlavor;
4import java.awt.datatransfer.Transferable;
7import javax.swing.JComponent;
8import javax.swing.TransferHandler;
10import org.apache.commons.logging.Log;
11import org.apache.commons.logging.LogFactory;
23@SuppressWarnings(
"serial")
31 c_provider = provider;
37 if (support ==
null)
return false;
38 if (!support.isDrop())
40 logger.debug(
"canImport: base just saying okay.");
47 logger.debug(
"createTransferable: at base, returning ListTransferable.");
52 protected void exportDone(JComponent source, Transferable data,
int action)
54 logger.debug(
"exportDone: base got event for component " + source.toString());
66 if (support ==
null)
return false;
67 logger.debug(
"importData: at base...");
69 if (support.isDataFlavorSupported(DataFlavor.javaFileListFlavor)) {
70 logger.debug(
"importing data with java files flavor");
72 if ((files !=
null) && (files.size() != 0)) {
73 c_provider.
consumeDropList(files, support.getDropLocation().getDropPoint());
78 logger.debug(
"importing data with uri list flavor");
80 if ((files !=
null) && (files.size() != 0)) {
81 c_provider.
consumeDropList(files, support.getDropLocation().getDropPoint());
85 logger.warn(
"passing importData request to superclass, which will probably fail.");
86 return super.importData(support);
Transferable createTransferable(JComponent c)
void exportDone(JComponent source, Transferable data, int action)
int getSourceActions(JComponent c)
boolean importData(TransferSupport support)
DragonTransferHandler(IDragonDropDataProvider provider)
boolean canImport(TransferSupport support)
static DataFlavor getURIListFlavor1()
static DataFlavor getURIListFlavor2()
static List< Object > extractData(Transferable tran)
boolean consumeDropList(List< Object > dropSet, Point cursor)
List< Object > provideDragList()