/** * Returns if this component can import the given Data within a TransferSupport * @param support The TransferSupport to be checked * @return Returns true if the Component can import the data, false if not */ public boolean canImport(STransferHandler.TransferSupport support) { return canImport(support.getComponent(), support.getDataFlavors()); }
private void drop(SComponent source, STransferHandler sourceTH, SComponent target, STransferHandler targetTH, int action, SMouseEvent mouseEvent) { // check for the custom drop-handler if (targetTH instanceof CustomDropHandler) { if (((CustomDropHandler) targetTH).drop(source, target, action, mouseEvent)) { return; } } transferSupport.setIsDrop(target, source, mouseEvent, action); if ((transferSupport.getSourceDropActions() & action) == 0) { // if dropping isn't allowed with the requested action resetDndStatus(); return; } // Import the data and call exportDone on the source-TH if (targetTH != null && targetTH.canImport(transferSupport)) { targetTH.importData(transferSupport); sourceTH.exportDone(source, transferSupport.getTransferable(), action); } resetDndStatus(); }
if (targetTH != null && targetTH.canImport(this.transferSupport)) { cursor.removeIcons("dnd"); switch (action) {