|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.TransferHandler
uk.ac.starlink.datanode.tree.DataNodeTransferHandler
public class DataNodeTransferHandler
Handles transferable exports to and from from the DataNodeJTree.
Field Summary |
---|
Fields inherited from class javax.swing.TransferHandler |
---|
COPY, COPY_OR_MOVE, MOVE, NONE |
Constructor Summary | |
---|---|
DataNodeTransferHandler()
|
Method Summary | |
---|---|
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). |
Methods inherited from class javax.swing.TransferHandler |
---|
exportAsDrag, exportDone, exportToClipboard, getCopyAction, getCutAction, getPasteAction |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DataNodeTransferHandler()
Method Detail |
---|
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 paste
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |