void (@NotNull Project project) { final ProjectWindowAction windowAction = findWindowAction(project.getPresentableUrl()); if (windowAction == null) { return; } if (latest == windowAction) { final ProjectWindowAction previous = latest.getPrevious(); if (previous != latest) { latest = previous; } else { latest = null; } } remove(windowAction); final String projectName = getProjectDisplayName(project); final List<ProjectWindowAction> duplicateWindowActions = findWindowActionsWithProjectName(projectName); if (duplicateWindowActions.size() == 1) { duplicateWindowActions.get(0).getTemplatePresentation().setText(projectName); } windowAction.dispose(); }