JavaScript is disabled on your browser.
JavaScript is disabled on your browser.
Detail:
Field |
Constr |
Method
All Implemented Interfaces:
Serializable
public class DropTargetContext
extends Object
implements Serializable
A DropTargetContext
is created
whenever the logical cursor associated
with a Drag and Drop operation coincides with the visible geometry of
a Component
associated with a DropTarget
.
The DropTargetContext
provides
the mechanism for a potential receiver
of a drop operation to both provide the end user with the appropriate
drag under feedback, but also to effect the subsequent data transfer
if appropriate.
Since:
1.2
See Also:
Serialized Form
Nested Class Summary
Nested Classes
Modifier and Type
Class
Description
protected class
DropTargetContext.TransferableProxy
TransferableProxy
is a helper inner class that implements
Transferable
interface and serves as a proxy for another
Transferable
object which represents data transfer for
a particular drag-n-drop operation.
Method Summary
All Methods
Modifier and Type
Method
Description
protected void
acceptDrag (int dragOperation)
accept the Drag.
protected void
acceptDrop (int dropOperation)
called to signal that the drop is acceptable
using the specified operation.
protected Transferable
createTransferableProxy (Transferable t,
boolean local)
Creates a TransferableProxy to proxy for the specified
Transferable.
void
dropComplete (boolean success)
This method signals that the drop is completed and
if it was successful or not.
Component
getComponent ()
This method returns the Component
associated with
this DropTargetContext
.
protected DataFlavor []
getCurrentDataFlavors ()
get the available DataFlavors of the
Transferable
operand of this operation.
protected List <DataFlavor >
getCurrentDataFlavorsAsList ()
This method returns a the currently available DataFlavors
of the Transferable
operand
as a java.util.List
.
DropTarget
getDropTarget ()
This method returns the DropTarget
associated with this
DropTargetContext
.
protected int
getTargetActions ()
This method returns an int
representing the
current actions this DropTarget
will accept.
protected Transferable
getTransferable ()
get the Transferable (proxy) operand of this operation
protected boolean
isDataFlavorSupported (DataFlavor df)
This method returns a boolean
indicating if the given DataFlavor
is
supported by this DropTargetContext
.
protected void
rejectDrag ()
reject the Drag.
protected void
rejectDrop ()
called to signal that the drop is unacceptable.
protected void
setTargetActions (int actions)
This method sets the current actions acceptable to
this DropTarget
.
Methods inherited from class java.lang.Object
clone , equals , finalize , getClass , hashCode , notify , notifyAll , toString , wait , wait , wait
Method Detail
createTransferableProxy
protected Transferable createTransferableProxy(Transferable t,
boolean local)
Creates a TransferableProxy to proxy for the specified
Transferable.
Parameters:
t
- the Transferable
to be proxied
local
- true
if t
represents
the result of a local drag-n-drop operation.
Returns:
the new TransferableProxy
instance.
JavaScript is disabled on your browser.
Detail:
Field |
Constr |
Method
Report a bug or suggest an enhancement For further API reference and developer documentation see the Java SE Documentation , which contains more detailed, developer-targeted descriptions with conceptual overviews, definitions of terms, workarounds, and working code examples. Java is a trademark or registered trademark of Oracle and/or its affiliates in the US and other countries. Copyright © 1993, 2017, Oracle and/or its affiliates, 500 Oracle Parkway, Redwood Shores, CA 94065 USA. All rights reserved. Use is subject to license terms and the documentation redistribution policy .
Scripting on this page tracks web page traffic, but does not change the content in any way.