void (@NotNull AnActionEvent e) { e.getPresentation().setEnabled(true); Project project = e.getProject(); if (project == null || project.isDisposed()) { e.getPresentation().setEnabledAndVisible(false); return; } ToolWindow toolWindow = e.getData(PlatformDataKeys.TOOL_WINDOW); if (toolWindow == null) { e.getPresentation().setEnabled(false); return; } ToolWindowManager manager = ToolWindowManager.getInstance(project); e.getPresentation().setText(manager.isMaximized(toolWindow) ? ActionsBundle.message("action.ResizeToolWindowMaximize.text.alternative") : ActionsBundle.message("action.ResizeToolWindowMaximize.text")); }