TransferHandler.TransferSupport (Java SE 19 & JDK 19) (original) (raw)

Enclosing class:

[TransferHandler](TransferHandler.html "class in javax.swing")


public static final class TransferHandler.TransferSupport extends Object

This class encapsulates all relevant details of a clipboard or drag and drop transfer, and also allows for customizing aspects of the drag and drop experience.

The main purpose of this class is to provide the information needed by a developer to determine the suitability of a transfer or to import the data contained within. But it also doubles as a controller for customizing properties during drag and drop, such as whether or not to show the drop location, and which drop action to use.

Developers typically need not create instances of this class. Instead, they are something provided by the DnD implementation to certain methods in TransferHandler.

Since:

1.6

See Also:

Constructors
Create a TransferSupport with isDrop() false for the given component andTransferable.

Returns the target component of this transfer.
Returns the data flavors for this transfer.
int
Returns the action chosen for the drop, when thisTransferSupport represents a drop.
Returns the current (non-null) drop location for the component, when this TransferSupport represents a drop.
int
Returns the drag source's supported drop actions, when thisTransferSupport represents a drop.
Returns the Transferable associated with this transfer.
int
Returns the user drop action for the drop, when thisTransferSupport represents a drop.
boolean
Returns whether or not the given data flavor is supported.
boolean
[isDrop](#isDrop%28%29)()
Returns whether or not this TransferSupport represents a drop operation.
void
[setDropAction](#setDropAction%28int%29)(int dropAction)
Sets the drop action for the transfer - which must represent a drop - to the given action, instead of the default user drop action.
void
[setShowDropLocation](#setShowDropLocation%28boolean%29)(boolean showDropLocation)
Sets whether or not the drop location should be visually indicated for the transfer - which must represent a drop.

Methods declared in class java.lang.Object

[clone](../../../java.base/java/lang/Object.html#clone%28%29), [equals](../../../java.base/java/lang/Object.html#equals%28java.lang.Object%29), [finalize](../../../java.base/java/lang/Object.html#finalize%28%29), [getClass](../../../java.base/java/lang/Object.html#getClass%28%29), [hashCode](../../../java.base/java/lang/Object.html#hashCode%28%29), [notify](../../../java.base/java/lang/Object.html#notify%28%29), [notifyAll](../../../java.base/java/lang/Object.html#notifyAll%28%29), [toString](../../../java.base/java/lang/Object.html#toString%28%29), [wait](../../../java.base/java/lang/Object.html#wait%28%29), [wait](../../../java.base/java/lang/Object.html#wait%28long%29), [wait](../../../java.base/java/lang/Object.html#wait%28long,int%29)