@Override public void pasteAsNodes(SModel model, SNode anchor, Project project) { String text = TextPasteUtil.getStringFromClipboard(); if (text != null && text.length() > MIN_TEXT_LENGTH_TO_CONVERT) { new JavaPaster().pasteJavaAsNode(anchor, model, text, null, FeatureKind.STATEMENTS, project); } }
@Override public PasteNodeData getPasteNodeData(SModel model, Project project) { // requires write action :( String text = TextPasteUtil.getStringFromClipboard(); if (text != null && text.length() > MIN_TEXT_LENGTH_TO_CONVERT) { SNodeTransferable transferable = new SNodeTransferable( JavaPaster.getStatementsFromJavaText(text, model, null, project), text); return transferable.createNodeData(); } return null; }
@Override public boolean canPasteAsNodes(SModel model, SNode anchor) { String text = TextPasteUtil.getStringFromClipboard(); return text != null && text.length() > MIN_TEXT_LENGTH_TO_CONVERT; }