/** * 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()); }
/** * Imports the data specified in TransferSupport into the component specified in TransferSupport * @param support * @return */ public boolean importData(STransferHandler.TransferSupport support) { return importData(support.getComponent(), support.getTransferable()); }
@Override public boolean importData(TransferSupport support) { if(support.isDrop()) { int index = ((STextComponent.DropLocation)support.getDropLocation()).getIndex(); ((STextComponent)support.getComponent()).setCaretPosition(index); ((STextComponent)support.getComponent()).setSelectionStart(index); ((STextComponent)support.getComponent()).setSelectionEnd(index); } return super.importData(support); }