diff --git a/platform/xdebugger-api/src/com/intellij/xdebugger/XDebugSession.java b/platform/xdebugger-api/src/com/intellij/xdebugger/XDebugSession.java index 534545847f42..be71aac98d1e 100644 --- a/platform/xdebugger-api/src/com/intellij/xdebugger/XDebugSession.java +++ b/platform/xdebugger-api/src/com/intellij/xdebugger/XDebugSession.java @@ -83,6 +83,7 @@ public interface XDebugSession extends AbstractDebuggerSession { /** * @deprecated use {@link #setCurrentStackFrame(com.intellij.xdebugger.frame.XExecutionStack, com.intellij.xdebugger.frame.XStackFrame)} instead */ + @SuppressWarnings("UnusedDeclaration") void setCurrentStackFrame(@NotNull XStackFrame frame); /** diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/DebuggerSupport.java b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/DebuggerSupport.java index 42bee651e742..2fd665496ba6 100644 --- a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/DebuggerSupport.java +++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/DebuggerSupport.java @@ -19,7 +19,10 @@ import com.intellij.openapi.extensions.ExtensionPointName; import com.intellij.openapi.extensions.Extensions; import com.intellij.openapi.project.Project; import com.intellij.xdebugger.AbstractDebuggerSession; -import com.intellij.xdebugger.impl.actions.*; +import com.intellij.xdebugger.impl.actions.DebuggerActionHandler; +import com.intellij.xdebugger.impl.actions.DebuggerToggleActionHandler; +import com.intellij.xdebugger.impl.actions.EditBreakpointActionHandler; +import com.intellij.xdebugger.impl.actions.MarkObjectActionHandler; import com.intellij.xdebugger.impl.breakpoints.ui.BreakpointPanelProvider; import com.intellij.xdebugger.impl.evaluate.quick.common.QuickEvaluateHandler; import com.intellij.xdebugger.impl.settings.DebuggerSettingsPanelProvider; @@ -116,6 +119,6 @@ public abstract class DebuggerSupport { return support; } } - return null; + throw new IllegalStateException(); } } diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/XDebugSessionImpl.java b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/XDebugSessionImpl.java index ea407a2cfcd4..d32c26cf8bac 100644 --- a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/XDebugSessionImpl.java +++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/XDebugSessionImpl.java @@ -780,7 +780,7 @@ public class XDebugSessionImpl implements XDebugSession { myBreakpointsDisabled = false; new ReadAction() { @Override - protected void run(final Result result) { + protected void run(@NotNull Result result) { processAllBreakpoints(true, false); } }.execute(); diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/XDebuggerSupport.java b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/XDebuggerSupport.java index c56f2c723261..0215c37812cb 100644 --- a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/XDebuggerSupport.java +++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/XDebuggerSupport.java @@ -54,7 +54,7 @@ public class XDebuggerSupport extends DebuggerSupport { private final DebuggerToggleActionHandler myMuteBreakpointsHandler; private final DebuggerActionHandler mySmartStepIntoHandler; private final XMarkObjectActionHandler myMarkObjectActionHandler; - private final EditBreakpointActionHandler myEditBreakpointActoinHandler; + private final EditBreakpointActionHandler myEditBreakpointActionHandler; public XDebuggerSupport() { myBreakpointPanelProvider = new XBreakpointPanelProvider(); @@ -62,26 +62,31 @@ public class XDebuggerSupport extends DebuggerSupport { myToggleTemporaryLineBreakpointActionHandler = new XToggleLineBreakpointActionHandler(true); myAddToWatchesActionHandler = new XAddToWatchesFromEditorActionHandler(); myStepOverHandler = new XDebuggerSuspendedActionHandler() { + @Override protected void perform(@NotNull final XDebugSession session, final DataContext dataContext) { session.stepOver(false); } }; myStepIntoHandler = new XDebuggerSuspendedActionHandler() { + @Override protected void perform(@NotNull final XDebugSession session, final DataContext dataContext) { session.stepInto(); } }; myStepOutHandler = new XDebuggerSuspendedActionHandler() { + @Override protected void perform(@NotNull final XDebugSession session, final DataContext dataContext) { session.stepOut(); } }; myForceStepOverHandler = new XDebuggerSuspendedActionHandler() { + @Override protected void perform(@NotNull final XDebugSession session, final DataContext dataContext) { session.stepOver(true); } }; myForceStepIntoHandler = new XDebuggerSuspendedActionHandler() { + @Override protected void perform(@NotNull final XDebugSession session, final DataContext dataContext) { session.forceStepInto(); } @@ -90,16 +95,19 @@ public class XDebuggerSupport extends DebuggerSupport { myRunToCursorHandler = new XDebuggerRunToCursorActionHandler(false); myForceRunToCursor = new XDebuggerRunToCursorActionHandler(true); myResumeHandler = new XDebuggerActionHandler() { + @Override protected boolean isEnabled(@NotNull final XDebugSession session, final DataContext dataContext) { return session.isPaused(); } + @Override protected void perform(@NotNull final XDebugSession session, final DataContext dataContext) { session.resume(); } }; myPauseHandler = new XDebuggerPauseActionHandler(); myShowExecutionPointHandler = new XDebuggerSuspendedActionHandler() { + @Override protected void perform(@NotNull final XDebugSession session, final DataContext dataContext) { session.showExecutionPoint(); } @@ -109,64 +117,76 @@ public class XDebuggerSupport extends DebuggerSupport { myQuickEvaluateHandler = new XQuickEvaluateHandler(); mySettingsPanelProvider = new XDebuggerSettingsPanelProviderImpl(); myMarkObjectActionHandler = new XMarkObjectActionHandler(); - myEditBreakpointActoinHandler = new XDebuggerEditBreakpointActionHandler(); + myEditBreakpointActionHandler = new XDebuggerEditBreakpointActionHandler(); } + @Override @NotNull public BreakpointPanelProvider getBreakpointPanelProvider() { return myBreakpointPanelProvider; } + @Override @NotNull public DebuggerActionHandler getStepOverHandler() { return myStepOverHandler; } + @Override @NotNull public DebuggerActionHandler getStepIntoHandler() { return myStepIntoHandler; } + @Override @NotNull public DebuggerActionHandler getSmartStepIntoHandler() { return mySmartStepIntoHandler; } + @Override @NotNull public DebuggerActionHandler getStepOutHandler() { return myStepOutHandler; } + @Override @NotNull public DebuggerActionHandler getForceStepOverHandler() { return myForceStepOverHandler; } + @Override @NotNull public DebuggerActionHandler getForceStepIntoHandler() { return myForceStepIntoHandler; } + @Override @NotNull public DebuggerActionHandler getRunToCursorHandler() { return myRunToCursorHandler; } + @Override @NotNull public DebuggerActionHandler getForceRunToCursorHandler() { return myForceRunToCursor; } + @Override @NotNull public DebuggerActionHandler getResumeActionHandler() { return myResumeHandler; } + @Override @NotNull public DebuggerActionHandler getPauseHandler() { return myPauseHandler; } + @Override @NotNull public DebuggerActionHandler getToggleLineBreakpointHandler() { return myToggleLineBreakpointActionHandler; @@ -178,16 +198,19 @@ public class XDebuggerSupport extends DebuggerSupport { return myToggleTemporaryLineBreakpointActionHandler; } + @Override @NotNull public DebuggerActionHandler getShowExecutionPointHandler() { return myShowExecutionPointHandler; } + @Override @NotNull public DebuggerActionHandler getEvaluateHandler() { return myEvaluateHandler; } + @Override @NotNull public QuickEvaluateHandler getQuickEvaluateHandler() { return myQuickEvaluateHandler; @@ -199,6 +222,7 @@ public class XDebuggerSupport extends DebuggerSupport { return myAddToWatchesActionHandler; } + @Override @NotNull public DebuggerToggleActionHandler getMuteBreakpointsHandler() { return myMuteBreakpointsHandler; @@ -218,9 +242,10 @@ public class XDebuggerSupport extends DebuggerSupport { @NotNull @Override public EditBreakpointActionHandler getEditBreakpointAction() { - return myEditBreakpointActoinHandler; + return myEditBreakpointActionHandler; } + @Override @NotNull public DebuggerSettingsPanelProvider getSettingsPanelProvider() { return mySettingsPanelProvider; diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/actions/ShowExecutionPointAction.java b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/actions/ShowExecutionPointAction.java index a00e2618c5a5..12def64e36ef 100644 --- a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/actions/ShowExecutionPointAction.java +++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/actions/ShowExecutionPointAction.java @@ -15,13 +15,14 @@ */ package com.intellij.xdebugger.impl.actions; -import org.jetbrains.annotations.NotNull; import com.intellij.xdebugger.impl.DebuggerSupport; +import org.jetbrains.annotations.NotNull; /** * @author nik */ public class ShowExecutionPointAction extends XDebuggerActionBase { + @Override @NotNull protected DebuggerActionHandler getHandler(@NotNull final DebuggerSupport debuggerSupport) { return debuggerSupport.getShowExecutionPointHandler(); diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/actions/XDebuggerSuspendedActionHandler.java b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/actions/XDebuggerSuspendedActionHandler.java index 70ecabddcdea..0137fac87ac2 100644 --- a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/actions/XDebuggerSuspendedActionHandler.java +++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/actions/XDebuggerSuspendedActionHandler.java @@ -15,16 +15,16 @@ */ package com.intellij.xdebugger.impl.actions; +import com.intellij.openapi.actionSystem.DataContext; import com.intellij.xdebugger.XDebugSession; import com.intellij.xdebugger.impl.actions.handlers.XDebuggerActionHandler; -import com.intellij.openapi.actionSystem.DataContext; import org.jetbrains.annotations.NotNull; /** * @author nik */ public abstract class XDebuggerSuspendedActionHandler extends XDebuggerActionHandler { - + @Override protected boolean isEnabled(final @NotNull XDebugSession session, final DataContext dataContext) { return session.isSuspended(); } diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/actions/handlers/XDebuggerActionHandler.java b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/actions/handlers/XDebuggerActionHandler.java index 3ac02a62dbdb..fa079b3ff707 100644 --- a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/actions/handlers/XDebuggerActionHandler.java +++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/actions/handlers/XDebuggerActionHandler.java @@ -15,19 +15,19 @@ */ package com.intellij.xdebugger.impl.actions.handlers; -import com.intellij.xdebugger.impl.actions.DebuggerActionHandler; -import com.intellij.xdebugger.XDebuggerManager; -import com.intellij.xdebugger.XDebugSession; -import com.intellij.openapi.project.Project; import com.intellij.openapi.actionSystem.AnActionEvent; import com.intellij.openapi.actionSystem.DataContext; +import com.intellij.openapi.project.Project; +import com.intellij.xdebugger.XDebugSession; +import com.intellij.xdebugger.XDebuggerManager; +import com.intellij.xdebugger.impl.actions.DebuggerActionHandler; import org.jetbrains.annotations.NotNull; /** * @author nik */ public abstract class XDebuggerActionHandler extends DebuggerActionHandler { - + @Override public void perform(@NotNull final Project project, final AnActionEvent event) { XDebugSession session = XDebuggerManager.getInstance(project).getCurrentSession(); if (session != null) { @@ -35,6 +35,7 @@ public abstract class XDebuggerActionHandler extends DebuggerActionHandler { } } + @Override public boolean isEnabled(@NotNull final Project project, final AnActionEvent event) { XDebugSession session = XDebuggerManager.getInstance(project).getCurrentSession(); return session != null && isEnabled(session, event.getDataContext());