void () { DocumentationComponent component = createDocumentationComponent(); String actionText = CodeInsightBundle.message("javadoc.show.popup.automatically"); ToggleAction showPopupAction = ObjectUtils.tryCast(findAction(component, actionText), ToggleAction.class); assertNotNull(showPopupAction); CodeInsightSettings settings = CodeInsightSettings.getInstance(); boolean info = settings.AUTO_POPUP_JAVADOC_INFO; try { AnActionEvent event = createEvent(); assertEquals(info, showPopupAction.isSelected(event)); showPopupAction.setSelected(event, true); assertTrue(showPopupAction.isSelected(event)); assertTrue(settings.AUTO_POPUP_JAVADOC_INFO); showPopupAction.setSelected(event, false); assertFalse(settings.AUTO_POPUP_JAVADOC_INFO); assertFalse(showPopupAction.isSelected(event)); } finally { settings.AUTO_POPUP_JAVADOC_INFO = info; } }