1 package com
.intellij
.xdebugger
.impl
.actions
;
3 import com
.intellij
.execution
.actions
.ChooseDebugConfigurationAction
;
4 import com
.intellij
.openapi
.actionSystem
.AnActionEvent
;
5 import com
.intellij
.openapi
.actionSystem
.PlatformDataKeys
;
6 import com
.intellij
.openapi
.actionSystem
.ActionPlaces
;
7 import com
.intellij
.openapi
.project
.Project
;
8 import com
.intellij
.xdebugger
.impl
.DebuggerSupport
;
9 import com
.intellij
.xdebugger
.AbstractDebuggerSession
;
10 import org
.jetbrains
.annotations
.NotNull
;
15 public class ResumeAction
extends XDebuggerActionBase
{
17 protected boolean isEnabled(AnActionEvent e
) {
18 Project project
= e
.getData(PlatformDataKeys
.PROJECT
);
19 if (project
== null) return false;
21 boolean haveCurrentSession
= false;
22 for (DebuggerSupport support
: DebuggerSupport
.getDebuggerSupports()) {
23 final AbstractDebuggerSession session
= support
.getCurrentSession(project
);
24 if (session
!= null && !session
.isStopped()) {
25 haveCurrentSession
= true;
26 if (session
.isPaused()) {
31 return !ActionPlaces
.DEBUGGER_TOOLBAR
.equals(e
.getPlace()) && !haveCurrentSession
;
35 public void actionPerformed(AnActionEvent e
) {
36 if (!performWithHandler(e
)) {
37 new ChooseDebugConfigurationAction().actionPerformed(e
);
42 protected DebuggerActionHandler
getHandler(@NotNull final DebuggerSupport debuggerSupport
) {
43 return debuggerSupport
.getResumeActionHandler();