diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/actions/EditBreakpointActionHandler.java b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/actions/EditBreakpointActionHandler.java index 5f76040b9cfd..ead1544e05ae 100644 --- a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/actions/EditBreakpointActionHandler.java +++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/actions/EditBreakpointActionHandler.java @@ -1,4 +1,4 @@ -// Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.xdebugger.impl.actions; import com.intellij.openapi.actionSystem.AnActionEvent; @@ -38,7 +38,9 @@ public abstract class EditBreakpointActionHandler extends DebuggerActionHandler } public void editBreakpoint(@NotNull Project project, @NotNull Editor editor, @NotNull Object breakpoint, @NotNull GutterIconRenderer breakpointGutterRenderer) { - if (BreakpointsDialogFactory.getInstance(project).isBreakpointPopupShowing()) return; + if (BreakpointsDialogFactory.getInstance(project).popupRequested(breakpoint)) { + return; + } EditorGutterComponentEx gutterComponent = ((EditorEx)editor).getGutterComponentEx(); Point point = gutterComponent.getCenterPoint(breakpointGutterRenderer); if (point == null) { // disabled gutter icons for example diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/ui/BreakpointsDialog.java b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/ui/BreakpointsDialog.java index cdd5c89704b0..2097348dcb99 100644 --- a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/ui/BreakpointsDialog.java +++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/ui/BreakpointsDialog.java @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2017 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.xdebugger.impl.breakpoints.ui; import com.intellij.icons.AllIcons; @@ -451,7 +437,13 @@ public class BreakpointsDialog extends DialogWrapper { } } - private boolean selectBreakpoint(Object breakpoint) { + @Override + public void toFront() { + getWindow().setBounds(getWindow().getBounds()); // will fo fit to screen + super.toFront(); + } + + public boolean selectBreakpoint(Object breakpoint) { if (breakpoint != null) { for (BreakpointItem item : myBreakpointItems) { if (item.getBreakpoint() == breakpoint) { diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/ui/BreakpointsDialogFactory.java b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/ui/BreakpointsDialogFactory.java index e0fe6457aff1..519e851fc6fe 100644 --- a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/ui/BreakpointsDialogFactory.java +++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/ui/BreakpointsDialogFactory.java @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2015 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.xdebugger.impl.breakpoints.ui; import com.intellij.openapi.Disposable; @@ -53,12 +39,21 @@ public class BreakpointsDialogFactory { return ServiceManager.getService(project, BreakpointsDialogFactory.class); } - public boolean isBreakpointPopupShowing() { - return (myBalloonToHide != null && !myBalloonToHide.isDisposed()) || myDialogShowing != null; + public boolean popupRequested(Object breakpoint) { + if (myBalloonToHide != null && !myBalloonToHide.isDisposed()) { + return true; + } + if (myDialogShowing != null) { + myDialogShowing.selectBreakpoint(breakpoint); + myDialogShowing.toFront(); + return true; + } + return false; } public void showDialog(@Nullable Object initialBreakpoint) { if (myDialogShowing != null) { + myDialogShowing.toFront(); return; }