mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
ensure breakpoints dialog is visible on shortcut - IDEA-189504
This commit is contained in:
+4
-2
@@ -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
|
||||
|
||||
+8
-16
@@ -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) {
|
||||
|
||||
+12
-17
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user