Package java.awt.datatransfer

Examples of java.awt.datatransfer.StringSelection


        int nrRows = taskOutput.getModel().getSize();
        for (int n=0; n < nrRows; n++) {
          output += taskOutput.getModel().getElementAt(n) + "\n";
        }

        StringSelection stringSelection = new StringSelection(output);
        clipboard.setContents(stringSelection, null);

        logger.info("Output copied to clipboard");
      }
    });
View Full Code Here


     *
     * @param s  Der zu kopierende Text.
     */
    public void copyToClipboard(final String s) {
        Toolkit.getDefaultToolkit().getSystemClipboard().setContents(
                new StringSelection(s), null);
    }
View Full Code Here

      int repeatCount = inputHandler.getRepeatCount();
      StringBuffer buf = new StringBuffer();
      for(int i = 0; i < repeatCount; i++)
        buf.append(selection);

      clipboard.setContents(new StringSelection(buf.toString()),null);
    }
  }
View Full Code Here

            String message = (String)tcTable.getValueAt(selectedRow, DETAILS);
            if (message == null) {
                message = "";
            }
            Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
            StringSelection data = new StringSelection(message);
            clipboard.setContents(data, data);
        }
View Full Code Here

                    }
                    messages.append(message);
                }
            }
            Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
            StringSelection data = new StringSelection(messages.toString());
            clipboard.setContents(data, data);
        }
View Full Code Here

                stringBuffer.append("\t");
             }
          }
          stringBuffer.append("\n");
       }
       StringSelection stringSelection  = new StringSelection(stringBuffer.toString());
       m_systemClipboard.setContents(stringSelection, stringSelection);
    }
View Full Code Here

          stringBuffer.append("\t");
        }
      }
      stringBuffer.append("\n");
    }
    StringSelection stringSelection = new StringSelection(
        stringBuffer.toString());
    m_systemClipboard.setContents(stringSelection, stringSelection);
  }
View Full Code Here

    public void dragDropEnd(DragSourceDropEvent dsde) {
       //
    }

    public void dragGestureRecognized(DragGestureEvent dge) {
        transferable = new StringSelection(((FileNode)((TCTreeNode)this.getSelectionPath().getLastPathComponent()).getUserObject()).getFile().getPath());
        //dge.startDrag(DragSource.DefaultCopyDrop, transferable);
        ds.startDrag(dge, DragSource.DefaultCopyDrop, transferable, this);
    }
View Full Code Here

      for (String selectedLine : selectedLines) {
        sb.append(selectedLine);
        sb.append(Constants.LINE_SEP);
      }
      clipboard
          .setContents(new StringSelection(sb.toString()), null /* ClipboardOwner */);
    }
  }
 
View Full Code Here

     *
     * @param s  Der zu kopierende Text.
     */
    public void copyToClipboard(final String s) {
        Toolkit.getDefaultToolkit().getSystemClipboard().setContents(
                new StringSelection(s), null);
    }
View Full Code Here

TOP

Related Classes of java.awt.datatransfer.StringSelection

Copyright © 2018 www.massapicom. 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.