boolean (@NotNull Transferable t, @Nullable Editor editor, Project project) { assert editor != null; final Document document = editor.getDocument(); final PsiFile target = PsiDocumentManager.getInstance(project).getPsiFile(document); if (!(target instanceof HtmlFileImpl)) return false; final VirtualFile file = getDroppedFile(t); if (file == null) return false; final FileType type = file.getFileType(); if (isCSS(type)) { return insertTagInHead((HtmlFileImpl)target, file, editor, "<link rel={0}stylesheet{0} href={0}{1}{0}>"); } if (isJS(type)) { return insertTagInHead((HtmlFileImpl)target, file, editor, "<script src={0}{1}{0}></script>"); } if (isImage(type)) { return insertImageTag((HtmlFileImpl)target, file, editor, "<img src={0}{1}{0}/>"); } return false; }