Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.7.0)

E13403-08

oracle.ide.util.dnd
Interface DropHelper


public interface DropHelper

Defines the interface for classes that can handle a data transfer (drop) operation.


Method Summary
 boolean canTransferData(java.lang.Object dropTarget, java.awt.datatransfer.DataFlavor[] transferFlavors, int action)
          Indicates whether a component would accept an import of the given set of data flavors prior to actually attempting to import it.
 float getWeight()
          Gets the sort weight for the helper.
 boolean transferData(java.lang.Object dropTarget, java.awt.datatransfer.Transferable[] transferablesForSelection, int action)
          Causes a transfer to a component from a clipboard or a drag-and-drop operation.
 

Method Detail

canTransferData

boolean canTransferData(java.lang.Object dropTarget,
                        java.awt.datatransfer.DataFlavor[] transferFlavors,
                        int action)
Indicates whether a component would accept an import of the given set of data flavors prior to actually attempting to import it.

Parameters:
dropTarget - the object that will receive the transfer
transferFlavors - the DataFlavor, or formats available for a transfer operation
action - the current drop action as defined in DnDConstants
Returns:
true if the data can be inserted into the component, false otherwise
See Also:
DataFlavor, DnDConstants

transferData

boolean transferData(java.lang.Object dropTarget,
                     java.awt.datatransfer.Transferable[] transferablesForSelection,
                     int action)
Causes a transfer to a component from a clipboard or a drag-and-drop operation. The Transferable represents the data to be imported into the component.

Parameters:
dropTarget - the object that will receive the transfer
transferablesForSelection - an array of Transferables for the drag selection
action - the current drop action as defined in DnDConstants
Returns:
true if the data was inserted into the component, false otherwise
See Also:
Transferable, DnDConstants

getWeight

float getWeight()
Gets the sort weight for the helper.

Because only one DropHelper can be used to handle drops on a given drop target, weights are used to determine which drop helper to use. The higher weight values have priority over lower weight values. If two helpers have the same weight, the first one found will have priority.

The maximum weight is Float.MAX_VALUE.

Returns:
the DropHelper's weight

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.7.0)

E13403-08

Copyright © 1997, 2013, Oracle. All rights reserved.