/** * Places the selected text into the clipboard. */ public void copy() { if(selectionStart != selectionEnd) { Clipboard clipboard = getToolkit().getSystemClipboard(); String selection = getSelectedText(); 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); } }
public void actionPerformed(ActionEvent evt) { JEditTextArea textArea = getTextArea(evt); String str = evt.getActionCommand(); int repeatCount = textArea.getInputHandler().getRepeatCount(); if(textArea.isEditable()) { StringBuffer buf = new StringBuffer(); for(int i = 0; i < repeatCount; i++) buf.append(str); textArea.overwriteSetSelectedText(buf.toString()); } else { textArea.getToolkit().beep(); } } }
int _repeatCount = getRepeatCount();
.replace('\r','\n'); int repeatCount = inputHandler.getRepeatCount(); StringBuffer buf = new StringBuffer(); for(int i = 0; i < repeatCount; i++)