if(textArea.isEditable()) { StringBuffer buf = new StringBuffer(); for(int i = 0; i < repeatCount; i++) buf.append(str); textArea.overwriteSetSelectedText(buf.toString()); } else { view.getToolkit().beep(); }
StringBuffer buf = new StringBuffer(); for(int i = 0; i < repeatCount; i++) buf.append(str); textArea.overwriteSetSelectedText(buf.toString());
	public void actionPerformed(ActionEvent evt)	{		View view = getView(evt);		String noWordSep = (String)view.getBuffer().getProperty("noWordSep");		String str = evt.getActionCommand();		char ch = str.charAt(0);		if(Abbrevs.getExpandOnInput() && !Character.isLetterOrDigit(ch)			&& (noWordSep == null || noWordSep.indexOf(ch) == -1))		{			// non-word char entered			// try to expand the abbrev first			Abbrevs.expandAbbrev(view,false);		}		JEditTextArea textArea = view.getTextArea();		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		{			view.getToolkit().beep();		}	}