use of java.awt.dnd.peer.DropTargetContextPeer in project jdk8u_jdk by JetBrains.
the class DropTargetContext method setTargetActions.
/**
* This method sets the current actions acceptable to
* this <code>DropTarget</code>.
* <P>
* @param actions an <code>int</code> representing the supported action(s)
*/
protected void setTargetActions(int actions) {
DropTargetContextPeer peer = getDropTargetContextPeer();
if (peer != null) {
synchronized (peer) {
peer.setTargetActions(actions);
getDropTarget().doSetDefaultActions(actions);
}
} else {
getDropTarget().doSetDefaultActions(actions);
}
}
use of java.awt.dnd.peer.DropTargetContextPeer in project jdk8u_jdk by JetBrains.
the class DropTargetContext method getTransferable.
/**
* get the Transferable (proxy) operand of this operation
* <P>
* @throws InvalidDnDOperationException if a drag is not outstanding/extant
* <P>
* @return the <code>Transferable</code>
*/
protected Transferable getTransferable() throws InvalidDnDOperationException {
DropTargetContextPeer peer = getDropTargetContextPeer();
if (peer == null) {
throw new InvalidDnDOperationException();
} else {
if (transferable == null) {
Transferable t = peer.getTransferable();
boolean isLocal = peer.isTransferableJVMLocal();
synchronized (this) {
if (transferable == null) {
transferable = createTransferableProxy(t, isLocal);
}
}
}
return transferable;
}
}
Aggregations