IDEA-55029 On breakpoint hit, cursor focus does not switch to breakpoint location

This commit is contained in:
Denis Fokin
2018-05-07 20:20:20 +03:00
parent f25fc66254
commit c53b0b87bc
6 changed files with 18 additions and 7 deletions
@@ -480,9 +480,7 @@ public class ContentManagerImpl implements ContentManager, PropertyChangeListene
addSelectedContent(content);
if (requestFocus) {
content.getComponent().transferFocus();
}
requestFocus(content, forcedFocus);
return ActionCallback.DONE;
}
};
@@ -28,6 +28,7 @@ import com.intellij.xdebugger.XSourcePosition;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import javax.swing.*;
import java.awt.*;
import java.util.EventObject;
@@ -44,6 +45,8 @@ public abstract class XDebugView implements Disposable {
myClearAlarm = new SingleAlarm(() -> clear(), VIEW_CLEAR_DELAY, this);
}
abstract JComponent getDefaultFocusedComponent();
protected final void requestClear() {
myClearAlarm.cancelAndRequest();
}
@@ -158,6 +158,10 @@ public class XFramesView extends XDebugView {
myMainPanel.add(myThreadsPanel, BorderLayout.NORTH);
}
public JComponent getDefaultFocusedComponent() {
return myFramesList;
}
private class ThreadsBuilder implements XSuspendContext.XExecutionStackContainer {
private volatile boolean myObsolete;
@@ -21,6 +21,8 @@ class XThreadsView(val project: Project, session: XDebugSessionImpl) : XDebugVie
private fun getTree() = treePanel.tree
fun getPanel() = treePanel.mainPanel
public override fun getDefaultFocusedComponent() = treePanel.tree
override fun clear() {
DebuggerUIUtil.invokeLater {
getTree().setRoot(object : XValueContainerNode<XValueContainer>(getTree(), null, true, object : XValueContainer() {}) {}, false)
@@ -63,6 +63,10 @@ public abstract class XVariablesViewBase extends XDebugView {
DnDManager.getInstance().registerSource(myTreePanel, getTree());
}
public JComponent getDefaultFocusedComponent() {
return myTreePanel.getTree();
}
protected void buildTreeAndRestoreState(@NotNull final XStackFrame stackFrame) {
XSourcePosition position = stackFrame.getSourcePosition();
XDebuggerTree tree = getTree();
@@ -191,7 +191,7 @@ public class XDebugSessionTab extends DebuggerSessionTabBase {
registerView(DebuggerContentInfo.VARIABLES_CONTENT, variablesView);
Content result = myUi.createContent(DebuggerContentInfo.VARIABLES_CONTENT, variablesView.getPanel(),
XDebuggerBundle.message("debugger.session.tab.variables.title"),
AllIcons.Debugger.Value, null);
AllIcons.Debugger.Value, variablesView.getDefaultFocusedComponent());
result.setCloseable(false);
ActionGroup group = getCustomizedActionGroup(XDebuggerActions.VARIABLES_TREE_TOOLBAR_GROUP);
@@ -203,7 +203,7 @@ public class XDebugSessionTab extends DebuggerSessionTabBase {
myWatchesView = new XWatchesViewImpl(session, myWatchesInVariables);
registerView(DebuggerContentInfo.WATCHES_CONTENT, myWatchesView);
Content watchesContent = myUi.createContent(DebuggerContentInfo.WATCHES_CONTENT, myWatchesView.getPanel(),
XDebuggerBundle.message("debugger.session.tab.watches.title"), AllIcons.Debugger.Watch, null);
XDebuggerBundle.message("debugger.session.tab.watches.title"), AllIcons.Debugger.Watch, myWatchesView.getDefaultFocusedComponent());
watchesContent.setCloseable(false);
return watchesContent;
}
@@ -213,7 +213,7 @@ public class XDebugSessionTab extends DebuggerSessionTabBase {
XFramesView framesView = new XFramesView(myProject);
registerView(DebuggerContentInfo.FRAME_CONTENT, framesView);
Content framesContent = myUi.createContent(DebuggerContentInfo.FRAME_CONTENT, framesView.getMainPanel(),
XDebuggerBundle.message("debugger.session.tab.frames.title"), AllIcons.Debugger.Frame, null);
XDebuggerBundle.message("debugger.session.tab.frames.title"), AllIcons.Debugger.Frame, framesView.getDefaultFocusedComponent());
framesContent.setCloseable(false);
return framesContent;
}
@@ -224,7 +224,7 @@ public class XDebugSessionTab extends DebuggerSessionTabBase {
registerView(DebuggerContentInfo.THREADS_CONTENT, stacksView);
Content framesContent = myUi.createContent(DebuggerContentInfo.THREADS_CONTENT, stacksView.getPanel(),
XDebuggerBundle.message("debugger.session.tab.threads.title"), AllIcons.Debugger.Threads,
null);
stacksView.getDefaultFocusedComponent());
framesContent.setCloseable(false);
return framesContent;
}