MCPcopy Create free account
hub / github.com/benfry/processing4 / copy

Method copy

app/src/processing/app/syntax/JEditTextArea.java:1750–1764  ·  view source on GitHub ↗

Places the selected text into the clipboard. If no selection is made, the whole line with caret will be selectd.

()

Source from the content-addressed store, hash-verified

1748 * If no selection is made, the whole line with caret will be selectd.
1749 */
1750 public void copy() {
1751 if (selectionStart == selectionEnd) {
1752 selectLine(getCaretLine());
1753 }
1754 Clipboard clipboard = getToolkit().getSystemClipboard();
1755 String selection = getSelectedText();
1756 if (selection != null) {
1757 int repeatCount = inputHandler.getRepeatCount();
1758 StringBuilder sb = new StringBuilder();
1759 for(int i = 0; i < repeatCount; i++) {
1760 sb.append(selection);
1761 }
1762 clipboard.setContents(new StringSelection(sb.toString()), null);
1763 }
1764 }
1765
1766
1767 /**

Callers 1

cutMethod · 0.95

Calls 7

selectLineMethod · 0.95
getCaretLineMethod · 0.95
getSelectedTextMethod · 0.95
getSystemClipboardMethod · 0.80
getRepeatCountMethod · 0.80
appendMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected