boolean (@NotNull JComponent comp, @NotNull DataFlavor[] transferFlavors) { Editor editor = getEditor(comp); final EditorDropHandler dropHandler = ((EditorImpl)editor).getDropHandler(); if (dropHandler != null && dropHandler.canHandleDrop(transferFlavors)) { return true; } if (editor.isViewer()) return false; int offset = editor.getCaretModel().getOffset(); if (editor.getDocument().getRangeGuard(offset, offset) != null) return false; for (DataFlavor transferFlavor : transferFlavors) { if (transferFlavor.equals(DataFlavor.stringFlavor)) return true; } return false; }