コード例 #1
0
 @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);
   }
 }
コード例 #2
0
 @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;
 }
コード例 #3
0
 @Override
 public boolean canPasteAsNodes(SModel model, SNode anchor) {
   String text = TextPasteUtil.getStringFromClipboard();
   return text != null && text.length() > MIN_TEXT_LENGTH_TO_CONVERT;
 }