public class EntryTableTransferHandler
extends javax.swing.TransferHandler
| Modifier and Type | Field and Description |
|---|---|
protected static boolean |
DROP_ALLOWED |
protected MainTable |
entryTable |
protected JabRefFrame |
frame |
protected java.awt.datatransfer.DataFlavor |
stringFlavor |
protected java.awt.datatransfer.DataFlavor |
urlFlavor |
| Constructor and Description |
|---|
EntryTableTransferHandler(MainTable entryTable,
JabRefFrame frame,
BasePanel panel)
Construct the transfer handler.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
canImport(javax.swing.JComponent comp,
java.awt.datatransfer.DataFlavor[] transferFlavors)
This method is called to query whether the transfer can be imported.
|
java.awt.datatransfer.Transferable |
createTransferable(javax.swing.JComponent c)
This method is called when dragging stuff *from* the table.
|
void |
exportAsDrag(javax.swing.JComponent comp,
java.awt.event.InputEvent e,
int action) |
protected void |
exportDone(javax.swing.JComponent source,
java.awt.datatransfer.Transferable data,
int action) |
void |
exportToClipboard(javax.swing.JComponent comp,
java.awt.datatransfer.Clipboard clip,
int action) |
static java.util.List<java.io.File> |
getFilesFromDraggedFilesString(java.lang.String s)
Translate a String describing a set of files or URLs dragged into JabRef
into a List of File objects, taking care of URL special characters.
|
int |
getSourceActions(javax.swing.JComponent c)
Overriden to indicate which types of drags are supported (only LINK).
|
protected boolean |
handleDropTransfer(java.lang.String dropStr,
int dropRow) |
protected boolean |
handleDropTransfer(java.net.URL dropLink,
int dropRow) |
boolean |
importData(javax.swing.JComponent comp,
java.awt.datatransfer.Transferable t)
This method is called when stuff is drag to the component.
|
protected final MainTable entryTable
protected JabRefFrame frame
protected java.awt.datatransfer.DataFlavor urlFlavor
protected java.awt.datatransfer.DataFlavor stringFlavor
protected static boolean DROP_ALLOWED
public EntryTableTransferHandler(MainTable entryTable, JabRefFrame frame, BasePanel panel)
entryTable - The table this transfer handler should operate on. This
argument is allowed to equalframe - The JabRefFrame instance.panel - The BasePanel this transferhandler works for.public int getSourceActions(javax.swing.JComponent c)
getSourceActions in class javax.swing.TransferHandlerpublic java.awt.datatransfer.Transferable createTransferable(javax.swing.JComponent c)
createTransferable in class javax.swing.TransferHandlerpublic boolean importData(javax.swing.JComponent comp,
java.awt.datatransfer.Transferable t)
importData in class javax.swing.TransferHandlerpublic boolean canImport(javax.swing.JComponent comp,
java.awt.datatransfer.DataFlavor[] transferFlavors)
canImport in class javax.swing.TransferHandlerpublic void exportAsDrag(javax.swing.JComponent comp,
java.awt.event.InputEvent e,
int action)
exportAsDrag in class javax.swing.TransferHandlerprotected void exportDone(javax.swing.JComponent source,
java.awt.datatransfer.Transferable data,
int action)
exportDone in class javax.swing.TransferHandlerpublic void exportToClipboard(javax.swing.JComponent comp,
java.awt.datatransfer.Clipboard clip,
int action)
exportToClipboard in class javax.swing.TransferHandlerprotected boolean handleDropTransfer(java.lang.String dropStr,
int dropRow)
throws java.io.IOException
java.io.IOExceptionpublic static java.util.List<java.io.File> getFilesFromDraggedFilesString(java.lang.String s)
s - String describing a set of files or URLs dragged into JabRefprotected boolean handleDropTransfer(java.net.URL dropLink,
int dropRow)
throws java.io.IOException
java.io.IOException