finally { buffer.endCompoundEdit(); }
	public void formatParagraph()	{		if(!buffer.isEditable())		{			getToolkit().beep();			return;		}		int maxLineLength = ((Integer)buffer.getProperty("maxLineLen"))			.intValue();		String text = getSelectedText();		if(text != null)			setSelectedText(TextUtilities.format(text,maxLineLength));		else		{			int lineNo = getCaretLine();			int start = 0, end = buffer.getLength();			for(int i = lineNo - 1; i >= 0; i--)			{				if(getLineLength(i) == 0)				{					start = getLineStartOffset(i);					break;				}			}			for(int i = lineNo + 1; i < getLineCount(); i++)			{				if(getLineLength(i) == 0)				{					end = getLineStartOffset(i);					break;				}			}			try			{				text = buffer.getText(start,end - start);				buffer.remove(start,end - start);				buffer.insertString(start,TextUtilities.format(					text,maxLineLength),null);			}			catch(BadLocationException bl)			{				return;			}		}	}