void () { hideBalloon(); if (!mySearchResults.isUpToDate()) return; final FindResult cursor = mySearchResults.getCursor(); final Editor editor = mySearchResults.getEditor(); final FindModel findModel = mySearchResults.getFindModel(); if (myDelegate != null && cursor != null && findModel.isReplaceState() && findModel.isRegularExpressions()) { String replacementPreviewText; try { replacementPreviewText = myDelegate.getStringToReplace(editor, cursor); } catch (FindManager.MalformedReplacementStringException e) { return; } if (replacementPreviewText == null) { return;//malformed replacement string } if (!replacementPreviewText.equals(findModel.getStringToReplace()) || Registry.is("ide.find.show.replacement.hint.for.simple.regexp")) { showBalloon(editor, replacementPreviewText); } } }