java.lang.Objectjavax.swing.TransferHandler.TransferInfo
public static final class TransferHandler.TransferInfo
This class tracks and provides the information needed to decide whether or not and how to import data.
Developers typically need not create instances of this
class. Instead, they are something provided by the DnD
implementation to certain methods in TransferHandler
.
TransferHandler.canImport(TransferHandler.TransferInfo)
,
TransferHandler.importData(TransferHandler.TransferInfo)
Constructor Summary | |
---|---|
TransferHandler.TransferInfo(Component component,
Transferable transferable)
Create a TransferInfo with isDrop()
false for the given component and
Transferable . |
Method Summary | |
---|---|
Component |
getComponent()
Returns the target component of this transfer. |
DataFlavor[] |
getDataFlavors()
Return the data flavors for this transfer. |
TransferHandler.DropLocation |
getDropLocation()
If this is a drop, return the current drop location for this component. |
Transferable |
getTransferable()
Returns the Transferable associated with this transfer. |
boolean |
isDataFlavorSupported(DataFlavor df)
Returns whether or not the given data flavor is supported. |
boolean |
isDrop()
Returns whether or not this TransferInfo
represents a drop operation. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TransferHandler.TransferInfo(Component component, Transferable transferable)
TransferInfo
with isDrop()
false
for the given component and
Transferable
.
component
- the target componenttransferable
- the transferable
NullPointerException
- if either parameter
is null
Method Detail |
---|
public boolean isDrop()
TransferInfo
represents a drop operation.
true
if this is a drop operation,
false
otherwise.public Component getComponent()
public TransferHandler.DropLocation getDropLocation()
null
.
Note: For components with built-in drop support, this location
will be a subclass of DropLocation
of the same
type returned by that component's getDropLocation
method.
null
public DataFlavor[] getDataFlavors()
public boolean isDataFlavorSupported(DataFlavor df)
df
- the DataFlavor
to test
public Transferable getTransferable()
Transferable
associated with this transfer.
Note: Unless it is necessary to fetch the Transferable
directly, use one of the other methods on this class to inquire about
the transfer. This may perform better than fetching the
Transferable
and asking it directly.
Transferable
associated with this transfer