view.getTextArea().replaceSelection(doFormat(text,
view.getTextArea().setSelectedText(doFormat(text,
	public void actionPerformed(ActionEvent evt)	{		View view = getView(evt);		if(!view.getTextArea().isEditable())		{			view.getToolkit().beep();			return;		}		Buffer buffer = view.getBuffer();		Object o = buffer.getProperty("maxLineLen");		int maxLineLength;		if(o instanceof Integer)			maxLineLength = ((Integer)o).intValue();		else			maxLineLength = 72;		String text = view.getTextArea().getSelectedText();		if(text != null)			view.getTextArea().replaceSelection(doFormat(text,				maxLineLength));		else		{			try			{				text = buffer.getText(0,buffer.getLength());				buffer.remove(0,buffer.getLength());				buffer.insertString(0,doFormat(text,					maxLineLength),null);			}			catch(BadLocationException bl)			{				return;			}		}	}