try { buffer.beginCompoundEdit(); Selection[] selection = getSelection(); for(int i = 0; i < selection.length; i++) setSelectedText(selection[i],null); } finally { buffer.endCompoundEdit(); }
setSelectedText(""); return;
	public void deleteWord()	{		if(!buffer.isEditable())		{			getToolkit().beep();			return;		}		if(selection.size() != 0)		{			try			{				buffer.beginCompoundEdit();				Selection[] selection = getSelection();				for(int i = 0; i < selection.length; i++)					setSelectedText(selection[i],null);			}			finally			{				buffer.endCompoundEdit();			}		}		int lineStart = getLineStartOffset(caretLine);		int _caret = caret - lineStart;		String lineText = getLineText(caretLine);		if(_caret == lineText.length())		{			if(lineStart + _caret == buffer.getLength())			{				getToolkit().beep();				return;			}			_caret++;		}		else		{			String noWordSep = (String)buffer.getProperty("noWordSep");			_caret = TextUtilities.findWordEnd(lineText,				_caret+1,noWordSep);		}		try		{			buffer.remove(caret,(_caret + lineStart) - caret);		}		catch(BadLocationException bl)		{			Log.log(Log.ERROR,this,bl);		}	}