mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
(WEB-36682) Take into account 'canPause' in PauseOutputAction
This commit is contained in:
@@ -42,23 +42,24 @@ public class PauseOutputAction extends ToggleAction implements DumbAware {
|
||||
public void update(@NotNull AnActionEvent event) {
|
||||
super.update(event);
|
||||
final Presentation presentation = event.getPresentation();
|
||||
RunContentDescriptor descriptor = StopAction.getRecentlyStartedContentDescriptor(event.getDataContext());
|
||||
ProcessHandler handler = descriptor != null ? descriptor.getProcessHandler() : null;
|
||||
if (handler != null && !handler.isProcessTerminated()) {
|
||||
presentation.setEnabled(true);
|
||||
ConsoleView consoleView = getConsoleView(event);
|
||||
if (consoleView == null || !consoleView.canPause()) {
|
||||
presentation.setEnabled(false);
|
||||
return;
|
||||
}
|
||||
if (!consoleView.hasDeferredOutput()) {
|
||||
presentation.setEnabled(false);
|
||||
}
|
||||
else {
|
||||
ConsoleView consoleView = getConsoleView(event);
|
||||
if (consoleView == null || !consoleView.canPause()) {
|
||||
presentation.setEnabled(false);
|
||||
return;
|
||||
}
|
||||
if (!consoleView.hasDeferredOutput()) {
|
||||
presentation.setEnabled(false);
|
||||
}
|
||||
else {
|
||||
RunContentDescriptor descriptor = StopAction.getRecentlyStartedContentDescriptor(event.getDataContext());
|
||||
ProcessHandler handler = descriptor != null ? descriptor.getProcessHandler() : null;
|
||||
if (handler != null && !handler.isProcessTerminated()) {
|
||||
presentation.setEnabled(true);
|
||||
}
|
||||
else {
|
||||
presentation.setEnabled(false);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user