overrides, notnull

This commit is contained in:
Vladimir Krivosheev
2014-02-27 13:14:59 +01:00
parent 4ecfba9775
commit 9df88a0b61
7 changed files with 45 additions and 14 deletions
@@ -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);
/**
@@ -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();
}
}
@@ -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();
@@ -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;
@@ -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();
@@ -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();
}
@@ -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());