public class DataNodeTransferHandler
extends javax.swing.TransferHandler
Constructor and Description |
---|
DataNodeTransferHandler() |
Modifier and Type | Method and Description |
---|---|
boolean |
canImport(javax.swing.JComponent comp,
java.awt.datatransfer.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 java.awt.datatransfer.Transferable |
createTransferable(javax.swing.JComponent comp) |
int |
getSourceActions(javax.swing.JComponent comp) |
javax.swing.Icon |
getVisualRepresentation(java.awt.datatransfer.Transferable trans) |
boolean |
importData(javax.swing.JComponent comp,
java.awt.datatransfer.Transferable trans)
Attempts to import a transferable into the tree.
|
void |
pasteSystemSelection(javax.swing.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).
|
public int getSourceActions(javax.swing.JComponent comp)
getSourceActions
in class javax.swing.TransferHandler
public javax.swing.Icon getVisualRepresentation(java.awt.datatransfer.Transferable trans)
getVisualRepresentation
in class javax.swing.TransferHandler
protected java.awt.datatransfer.Transferable createTransferable(javax.swing.JComponent comp)
createTransferable
in class javax.swing.TransferHandler
public void setNodeMaker(DataNodeFactory nodeMaker)
public boolean canImport(javax.swing.JComponent comp, java.awt.datatransfer.DataFlavor[] flavors)
canImport
in class javax.swing.TransferHandler
public boolean importData(javax.swing.JComponent comp, java.awt.datatransfer.Transferable trans)
importData
in class javax.swing.TransferHandler
public void pasteSystemSelection(javax.swing.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 © 2017 Central Laboratory of the Research Councils. All Rights Reserved.