Examples of StringSelection


Examples of java.awt.datatransfer.StringSelection

    JButton toClipboardBtn = new JButton("To Clipboard");
    toClipboardBtn.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
        StringSelection data = new StringSelection(getLogTextArea().getText());
        clipboard.setContents(data, data);
      }
    });
    toClipboardBtn.setPreferredSize(new Dimension(128, 28));
    toClipboardBtn.setForeground(SystemColor.menu);
View Full Code Here

Examples of java.awt.datatransfer.StringSelection

    try {
      Flame currFlame = getCurrFlame();
      if (currFlame != null) {
        Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
        String xml = new FlameWriter().getFlameXML(currFlame);
        StringSelection data = new StringSelection(xml);
        clipboard.setContents(data, data);
      }
    }
    catch (Throwable ex) {
      errorHandler.handleError(ex);
View Full Code Here

Examples of java.awt.datatransfer.StringSelection

  public void copy(Clipboard clipboard) {
    String data = terminal.getSelection();
    // check due to a bug in the hotspot vm
    if (data == null) return;
    StringSelection selection = new StringSelection(data);
    clipboard.setContents(selection, this);
  }
View Full Code Here

Examples of java.awt.datatransfer.StringSelection

    for (int i = 0; i < rows.length; i++) {
      TermStats ti = (TermStats)getProperty(rows[i], "ti");
      if (ti == null) continue;
      sb.append(ti.docFreq + "\t" + ti.field + "\t" + ti.termtext.utf8ToString() + "\n");
    }
    StringSelection sel = new StringSelection(sb.toString());
    Toolkit.getDefaultToolkit().getSystemClipboard().setContents(sel, this);
  }
View Full Code Here

Examples of java.awt.datatransfer.StringSelection

          sb.append(tf.starts[i] + "-" + tf.ends[i]);
        }
      }
      sb.append("\n");
    }
    StringSelection sel = new StringSelection(sb.toString());
    Toolkit.getDefaultToolkit().getSystemClipboard().setContents(sel, this);
  }
View Full Code Here

Examples of java.awt.datatransfer.StringSelection

      Field f = (Field) getProperty(rows[i], "field");
      if (f == null) continue;
      if (i > 0) sb.append('\n');
      sb.append(f.toString());
    }
    StringSelection sel = new StringSelection(sb.toString());
    Toolkit.getDefaultToolkit().getSystemClipboard().setContents(sel, this);
  }
View Full Code Here

Examples of java.awt.datatransfer.StringSelection

      Field f = (Field) getProperty(rows[i], "field");
      if (f == null) continue;
      if (i > 0) sb.append('\n');
      sb.append(f.toString());
    }
    StringSelection sel = new StringSelection(sb.toString());
    Toolkit.getDefaultToolkit().getSystemClipboard().setContents(sel, this);
  }
View Full Code Here

Examples of java.awt.datatransfer.StringSelection

      for (int k = 0; k < cells.length; k++) {
        if (k > 0) sb.append('\t');
        sb.append(getString(cells[k], "text"));
      }
    }
    StringSelection sel = new StringSelection(sb.toString());
    Toolkit.getDefaultToolkit().getSystemClipboard().setContents(sel, this);
  }
View Full Code Here

Examples of java.awt.datatransfer.StringSelection

 
  public void clipQExplain(Object qExplain) {
    Object tree  = find(qExplain, "qTree");
    StringBuilder sb = new StringBuilder();
    treeToString(tree, sb);
    StringSelection sel = new StringSelection(sb.toString());
    Toolkit.getDefaultToolkit().getSystemClipboard().setContents(sel, this);
  }
View Full Code Here

Examples of java.awt.datatransfer.StringSelection

 
  public void clipExplain(Object explain) {
    Object eTree = find(explain, "eTree");
    StringBuilder sb = new StringBuilder();
    treeToString(eTree, sb);
    StringSelection sel = new StringSelection(sb.toString());
    Toolkit.getDefaultToolkit().getSystemClipboard().setContents(sel, this);   
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.