void (@NotNull ContentManagerEvent event) { boolean onAdd = event.getOperation() == ContentManagerEvent.ContentOperation.add; Content content = event.getContent(); if (onAdd) { updateContentToolbar(content, false); updateServiceContent(content); } updateDashboard(true); if (onAdd) { RunConfigurationNode node = createNode(content); if (node != null) { RunnerAndConfigurationSettings settings = node.getConfigurationSettings(); ((ServiceViewManagerImpl)ServiceViewManager.getInstance(myProject)) .trackingSelect(node, RunDashboardServiceViewContributor.class, settings.isActivateToolWindowBeforeRun(), settings.isFocusToolWindowBeforeRun()) .onSuccess(selected -> { if (selected != Boolean.TRUE) { Content previousSelection = myPreviousSelection; if (previousSelection != null) { setSelectedContent(previousSelection); } } }) .onError(t -> { Content previousSelection = myPreviousSelection; if (previousSelection != null) { setSelectedContent(previousSelection); } }); } } else { myPreviousSelection = content; } }