public class DataNodeTransferHandler extends TransferHandler
TransferHandler.DropLocation, TransferHandler.TransferSupport
COPY, COPY_OR_MOVE, LINK, MOVE, NONE
Constructor and Description |
---|
DataNodeTransferHandler() |
Modifier and Type | Method and Description |
---|---|
boolean |
canImport(JComponent comp,
DataFlavor[] flavors)
If we are configured to import data, return true, on the grounds
that the DataNodeFactory should be able to have a go at
turning almost anything into a DataNode.
|
protected Transferable |
createTransferable(JComponent comp) |
int |
getSourceActions(JComponent comp) |
Icon |
getVisualRepresentation(Transferable trans) |
boolean |
importData(JComponent comp,
Transferable trans)
Attempts to import a transferable into the tree.
|
void |
pasteSystemSelection(JComponent comp)
Pastes the system selection into the tree window.
|
void |
setNodeMaker(DataNodeFactory nodeMaker)
Sets the DataNodeFactory which will be used by this handler to
perform import of Transferables (convert them into DataNodes).
|
canImport, exportAsDrag, exportDone, exportToClipboard, getCopyAction, getCutAction, getDragImage, getDragImageOffset, getPasteAction, importData, setDragImage, setDragImageOffset
public int getSourceActions(JComponent comp)
getSourceActions
in class TransferHandler
public Icon getVisualRepresentation(Transferable trans)
getVisualRepresentation
in class TransferHandler
protected Transferable createTransferable(JComponent comp)
createTransferable
in class TransferHandler
public void setNodeMaker(DataNodeFactory nodeMaker)
public boolean canImport(JComponent comp, DataFlavor[] flavors)
canImport
in class TransferHandler
public boolean importData(JComponent comp, Transferable trans)
importData
in class TransferHandler
public void pasteSystemSelection(JComponent comp)
This implementation only works with string-like contents of the selection. Short strings it feeds to the data node factory as Strings, and long ones it ignores.
comp
- the component into which to pasteCopyright © 2023 Central Laboratory of the Research Councils. All Rights Reserved.