コード例 #1
0
ファイル: HyperSearchResults.java プロジェクト: SELab/jEdit
 @Override
 public void actionPerformed(ActionEvent evt) {
   TreePath path = resultTree.getSelectionPath();
   DefaultMutableTreeNode operNode = (DefaultMutableTreeNode) path.getLastPathComponent();
   ToStringNodes toStringNodes = new ToStringNodes();
   traverseNodes(operNode, toStringNodes);
   StringSelection selection = new StringSelection(toStringNodes.nodesString.toString());
   Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
   clipboard.setContents(selection, null);
 }
コード例 #2
0
ファイル: HyperSearchResults.java プロジェクト: SELab/jEdit
 @Override
 public void exportToClipboard(JComponent comp, Clipboard clip, int action)
     throws IllegalStateException {
   TreePath[] paths = resultTree.getSelectionPaths();
   ToStringNodes toStringNodes = new ToStringNodes();
   for (TreePath path : paths) {
     DefaultMutableTreeNode operNode = (DefaultMutableTreeNode) path.getLastPathComponent();
     toStringNodes.processNode(operNode);
   }
   StringSelection selection = new StringSelection(toStringNodes.nodesString.toString());
   Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
   clipboard.setContents(selection, null);
 }