void (final boolean allowedToChangedEditorSelection) { final String text = myFindModel.getStringToFind(); if (text.isEmpty()) { nothingToSearchFor(allowedToChangedEditorSelection); } else { if (myFindModel.isRegularExpressions()) { try { Pattern.compile(text); } catch (PatternSyntaxException e) { myComponent.setNotFoundBackground(); myClickToHighlightLabel.setVisible(false); mySearchResults.clear(); myComponent.setStatusText(FindBundle.message(INCORRECT_REGEXP_MESSAGE_KEY)); return; } if (text.matches("\\|+")) { nothingToSearchFor(allowedToChangedEditorSelection); myComponent.setStatusText(ApplicationBundle.message("editorsearch.empty.string.matches")); return; } } final FindManager findManager = FindManager.getInstance(getProject()); if (allowedToChangedEditorSelection) { findManager.setFindWasPerformed(); FindModel copy = new FindModel(); copy.copyFrom(myFindModel); copy.setReplaceState(false); findManager.setFindNextModel(copy); } if (myLivePreviewController != null) { myLivePreviewController.updateInBackground(myFindModel, allowedToChangedEditorSelection); } } }