Package docking.widgets.tree.support
Class GTreeNodeTransferable
- java.lang.Object
-
- docking.widgets.tree.support.GTreeNodeTransferable
-
- All Implemented Interfaces:
java.awt.datatransfer.Transferable
- Direct Known Subclasses:
DataTreeNodeTransferable
public class GTreeNodeTransferable extends java.lang.Object implements java.awt.datatransfer.TransferableA transferable for sharing data via drag/drop and clipboard operations for GTrees.
-
-
Constructor Summary
Constructors Constructor Description GTreeNodeTransferable(GTreeTransferHandler handler, java.util.List<GTreeNode> selectedData)Creates this transferable based upon the selected data and uses the given transfer handler to performTransferableoperations.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<GTreeNode>getAllData()Returns all of the original selected data contained by this transferable.java.lang.ObjectgetTransferData(java.awt.datatransfer.DataFlavor flavor)Gets the transfer data from the selection based upon the given flavor.java.awt.datatransfer.DataFlavor[]getTransferDataFlavors()Returns the DataFlavors for the types of data that this transferable supports, based upon the given selection.booleanisDataFlavorSupported(java.awt.datatransfer.DataFlavor flavor)A convenience method to determine if this transferable supports the given flavor.
-
-
-
Constructor Detail
-
GTreeNodeTransferable
public GTreeNodeTransferable(GTreeTransferHandler handler, java.util.List<GTreeNode> selectedData)
Creates this transferable based upon the selected data and uses the given transfer handler to performTransferableoperations.- Parameters:
handler- the handler used to perform transfer operations.selectedData- The
-
-
Method Detail
-
getAllData
public java.util.List<GTreeNode> getAllData()
Returns all of the original selected data contained by this transferable.- Returns:
- all of the original selected data contained by this transferable
-
getTransferData
public java.lang.Object getTransferData(java.awt.datatransfer.DataFlavor flavor) throws java.awt.datatransfer.UnsupportedFlavorException, java.io.IOExceptionGets the transfer data from the selection based upon the given flavor.- Specified by:
getTransferDatain interfacejava.awt.datatransfer.Transferable- Parameters:
transferNodes- The nodes from which to get the data.flavor- The flavor of data to retreive from the given selection.- Returns:
- the transfer data from the selection based upon the given flavor.
- Throws:
java.awt.datatransfer.UnsupportedFlavorException- if the given flavor is not one of the supported flavors returned by#getSupportedDataFlavors(List).java.io.IOException
-
getTransferDataFlavors
public java.awt.datatransfer.DataFlavor[] getTransferDataFlavors()
Returns the DataFlavors for the types of data that this transferable supports, based upon the given selection.- Specified by:
getTransferDataFlavorsin interfacejava.awt.datatransfer.Transferable- Parameters:
transferNodes- The nodes to base the DataFlavor selection upon.- Returns:
- the DataFlavors for the types of data that this transferable supports, based upon the given selection.
-
isDataFlavorSupported
public boolean isDataFlavorSupported(java.awt.datatransfer.DataFlavor flavor)
A convenience method to determine if this transferable supports the given flavor.- Specified by:
isDataFlavorSupportedin interfacejava.awt.datatransfer.Transferable- Returns:
- true if this transferable supports the given flavor.
-
-