mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-97772 Make Watch Window visible when adding an expression to watches
This commit is contained in:
@@ -214,7 +214,7 @@ public class DebuggerPanelsManager implements ProjectComponent {
|
||||
public void toFront(DebuggerSession session) {
|
||||
DebuggerSessionTab sessionTab = getSessionTab(session);
|
||||
if (sessionTab != null) {
|
||||
sessionTab.toFront();
|
||||
sessionTab.toFront(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1271,6 +1271,17 @@ public class RunnerContentUi implements ContentUI, Disposable, CellTransform.Fac
|
||||
return null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public void restoreContent(final String key) {
|
||||
for (AnAction action : myMinimizedViewActions.getChildren(null)) {
|
||||
Content content = ((RestoreViewAction)action).getContent();
|
||||
if (key.equals(content.getUserData(ViewImpl.ID))) {
|
||||
action.actionPerformed(null);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void setToDisposeRemovedContent(final boolean toDispose) {
|
||||
myToDisposeRemovedContent = toDispose;
|
||||
}
|
||||
|
||||
@@ -713,7 +713,7 @@ public class XDebugSessionImpl implements XDebugSession {
|
||||
UIUtil.invokeLaterIfNeeded(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
mySessionTab.toFront();
|
||||
mySessionTab.toFront(true);
|
||||
mySessionTab.getUi().attractBy(XDebuggerUIConstants.LAYOUT_VIEW_BREAKPOINT_CONDITION);
|
||||
}
|
||||
});
|
||||
|
||||
+11
-2
@@ -33,6 +33,7 @@ import com.intellij.xdebugger.impl.XDebuggerUtilImpl;
|
||||
import com.intellij.xdebugger.impl.actions.XDebuggerActions;
|
||||
import com.intellij.xdebugger.impl.breakpoints.XExpressionImpl;
|
||||
import com.intellij.xdebugger.impl.settings.XDebuggerSettingsManager;
|
||||
import com.intellij.xdebugger.impl.ui.XDebugSessionTab;
|
||||
import com.intellij.xdebugger.impl.ui.XDebuggerEditorBase;
|
||||
import com.intellij.xdebugger.impl.ui.tree.XDebuggerTree;
|
||||
import com.intellij.xdebugger.impl.ui.tree.XDebuggerTreePanel;
|
||||
@@ -138,7 +139,11 @@ public class XDebuggerEvaluationDialog extends DialogWrapper {
|
||||
// add to watches
|
||||
XExpression expression = myInputComponent.getInputEditor().getExpression();
|
||||
if (!XDebuggerUtilImpl.isEmptyExpression(expression)) {
|
||||
((XDebugSessionImpl)mySession).getSessionTab().getWatchesView().addWatchExpression(expression, -1, false);
|
||||
XDebugSessionTab tab = ((XDebugSessionImpl)mySession).getSessionTab();
|
||||
if (tab != null) {
|
||||
tab.getWatchesView().addWatchExpression(expression, -1, true);
|
||||
requestFocusInEditor();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -195,7 +200,11 @@ public class XDebuggerEvaluationDialog extends DialogWrapper {
|
||||
|
||||
setTitle(myInputComponent.getTitle());
|
||||
mySwitchModeAction.putValue(Action.NAME, getSwitchButtonText(mode));
|
||||
final JComponent preferredFocusedComponent = myInputComponent.getInputEditor().getPreferredFocusedComponent();
|
||||
requestFocusInEditor();
|
||||
}
|
||||
|
||||
private void requestFocusInEditor() {
|
||||
JComponent preferredFocusedComponent = myInputComponent.getInputEditor().getPreferredFocusedComponent();
|
||||
if (preferredFocusedComponent != null) {
|
||||
IdeFocusManager.getInstance(mySession.getProject()).requestFocus(preferredFocusedComponent, true);
|
||||
}
|
||||
|
||||
@@ -15,6 +15,8 @@
|
||||
*/
|
||||
package com.intellij.xdebugger.impl.frame;
|
||||
|
||||
import com.intellij.debugger.ui.DebuggerContentInfo;
|
||||
import com.intellij.execution.ui.layout.impl.RunnerContentUi;
|
||||
import com.intellij.ide.DataManager;
|
||||
import com.intellij.ide.dnd.DnDEvent;
|
||||
import com.intellij.ide.dnd.DnDManager;
|
||||
@@ -36,6 +38,7 @@ import com.intellij.xdebugger.frame.XStackFrame;
|
||||
import com.intellij.xdebugger.impl.XDebugSessionImpl;
|
||||
import com.intellij.xdebugger.impl.actions.XDebuggerActions;
|
||||
import com.intellij.xdebugger.impl.breakpoints.XExpressionImpl;
|
||||
import com.intellij.xdebugger.impl.ui.XDebugSessionTab;
|
||||
import com.intellij.xdebugger.impl.ui.tree.XDebuggerTree;
|
||||
import com.intellij.xdebugger.impl.ui.tree.XDebuggerTreePanel;
|
||||
import com.intellij.xdebugger.impl.ui.tree.XDebuggerTreeRestorer;
|
||||
@@ -216,6 +219,24 @@ public class XWatchesViewImpl implements DnDNativeTarget, XWatchesView, XDebugVi
|
||||
public void addWatchExpression(@NotNull XExpression expression, int index, final boolean navigateToWatchNode) {
|
||||
myRootNode.addWatchExpression(mySession.getDebugProcess().getEvaluator(), expression, index, navigateToWatchNode);
|
||||
updateSessionData();
|
||||
if (navigateToWatchNode) {
|
||||
showWatchesTab();
|
||||
}
|
||||
}
|
||||
|
||||
private void showWatchesTab() {
|
||||
XDebugSessionTab tab = mySession.getSessionTab();
|
||||
if (tab != null) {
|
||||
tab.toFront(false);
|
||||
// restore watches tab if minimized
|
||||
JComponent component = tab.getUi().getComponent();
|
||||
if (component instanceof DataProvider) {
|
||||
RunnerContentUi ui = RunnerContentUi.KEY.getData(((DataProvider)component));
|
||||
if (ui != null) {
|
||||
ui.restoreContent(DebuggerContentInfo.WATCHES_CONTENT);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+12
-10
@@ -151,19 +151,21 @@ public abstract class DebuggerSessionTabBase extends LogConsoleManagerBase imple
|
||||
return environment != null ? environment.getRunProfile() : null;
|
||||
}
|
||||
|
||||
public void toFront() {
|
||||
public void toFront(boolean focus) {
|
||||
if (!ApplicationManager.getApplication().isUnitTestMode()) {
|
||||
ExecutionManager.getInstance(getProject()).getContentManager().toFrontRunContent(DefaultDebugExecutor.getDebugExecutorInstance(), myRunContentDescriptor);
|
||||
ApplicationManager.getApplication().invokeLater(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
boolean focusWnd = Registry.is("debugger.mayBringFrameToFrontOnBreakpoint");
|
||||
ProjectUtil.focusProjectWindow(getProject(), focusWnd);
|
||||
if (!focusWnd) {
|
||||
AppIcon.getInstance().requestAttention(getProject(), true);
|
||||
if (focus) {
|
||||
ApplicationManager.getApplication().invokeLater(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
boolean focusWnd = Registry.is("debugger.mayBringFrameToFrontOnBreakpoint");
|
||||
ProjectUtil.focusProjectWindow(getProject(), focusWnd);
|
||||
if (!focusWnd) {
|
||||
AppIcon.getInstance().requestAttention(getProject(), true);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user