record(view,"SearchAndReplace.replace(view);",true,false);
record(view,"replace(view)",true,false);
	public static boolean replace(View view)	{		JEditTextArea textArea = view.getTextArea();		if(!textArea.isEditable())		{			view.getToolkit().beep();			return false;		}		// setSelectedText() clears these values, so save them		int selStart = textArea.getSelectionStart();		boolean rect = textArea.isSelectionRectangular();		if(selStart == textArea.getSelectionEnd())		{			view.getToolkit().beep();			return false;		}		record(view,"SearchAndReplace.replace(view);",true,false);		try		{			SearchMatcher matcher = getSearchMatcher();			if(matcher == null)			{				view.getToolkit().beep();				return false;			}			String text = textArea.getSelectedText();			String replacement = matcher.substitute(text);			if(replacement == null || replacement.equals(text))				return false;			textArea.setSelectedText(replacement);			textArea.setSelectionStart(selStart);			textArea.setSelectionRectangular(rect);			return true;		}		catch(Exception e)		{			Log.log(Log.ERROR,SearchAndReplace.class,e);			Object[] args = { e.getMessage() };			if(args[0] == null)				args[0] = e.toString();			GUIUtilities.error(view,"searcherror",args);		}		return false;	}