void () { String origText = "first foo\n<selection>foo bar baz\nbaz bar foo</selection>\nlast foo"; init(origText); initFind(); EditorSearchSession session = getEditorSearchComponent(); FindModel model = session.getFindModel(); SearchReplaceComponent component = session.getComponent(); model.setStringToFind(""); model.setGlobal(false); Shortcut shortcut = ArrayUtil.getFirstElement(ActionManager.getInstance().getAction(IdeActions.ACTION_TOGGLE_FIND_IN_SELECTION_ONLY).getShortcutSet().getShortcuts()); if (shortcut != null) { assertEquals(ApplicationBundle.message("editorsearch.in.selection.with.hint", KeymapUtil.getShortcutText(shortcut)), ((ComponentWithEmptyText)component.getSearchTextComponent()).getEmptyText().getText()); } else { assertEquals(ApplicationBundle.message("editorsearch.in.selection"), ((ComponentWithEmptyText)component.getSearchTextComponent()).getEmptyText().getText()); } getEditor().getSelectionModel().removeSelection(); assertEquals(ApplicationBundle.message("editorsearch.in.selection"), ((ComponentWithEmptyText)component.getSearchTextComponent()).getEmptyText().getText()); }