AnAction (final InspectionResultsView view) { String message = InspectionsBundle.message(ExperimentalUI.isNewUI() ? "inspection.action.group.by.directory.new" : "inspection.action.group.by.directory"); return new InspectionResultsViewToggleAction(view, message, message, AllIcons.Actions.GroupByPackage) { @Override public boolean isSelected(@NotNull AnActionEvent e) { return SHOW_STRUCTURE; } @Override public void setSelected(boolean state) { SHOW_STRUCTURE = state; } @Override public @NotNull ActionUpdateThread getActionUpdateThread() { return ActionUpdateThread.BGT; } }; }