mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-162951 Esc must cancel template first, then close breakpoint popup
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
package com.intellij.xdebugger.impl.ui;
|
||||
|
||||
import com.intellij.codeInsight.lookup.LookupManager;
|
||||
import com.intellij.codeInsight.template.TemplateManager;
|
||||
import com.intellij.openapi.actionSystem.*;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.keymap.KeymapUtil;
|
||||
@@ -54,6 +55,7 @@ public class BreakpointEditor {
|
||||
|
||||
public interface Delegate {
|
||||
void done();
|
||||
|
||||
void more();
|
||||
}
|
||||
|
||||
@@ -77,16 +79,18 @@ public class BreakpointEditor {
|
||||
public void update(AnActionEvent e) {
|
||||
super.update(e);
|
||||
Project project = getEventProject(e);
|
||||
boolean lookup = project != null && LookupManager.getInstance(project).getActiveLookup() != null;
|
||||
Editor editor = e.getData(CommonDataKeys.EDITOR);
|
||||
boolean disabled = project != null &&
|
||||
(LookupManager.getInstance(project).getActiveLookup() != null ||
|
||||
(editor != null && TemplateManager.getInstance(project).getActiveTemplate(editor) != null));
|
||||
final Component owner = IdeFocusManager.findInstance().getFocusOwner();
|
||||
if (owner != null) {
|
||||
final JComboBox comboBox = UIUtil.getParentOfType(JComboBox.class, owner);
|
||||
if (comboBox != null && comboBox.isPopupVisible()) {
|
||||
lookup = true;
|
||||
disabled = true;
|
||||
}
|
||||
}
|
||||
e.getPresentation().setEnabled(!lookup && (editor == null || StringUtil.isEmpty(editor.getSelectionModel().getSelectedText())) );
|
||||
e.getPresentation().setEnabled(!disabled && (editor == null || StringUtil.isEmpty(editor.getSelectionModel().getSelectedText())) );
|
||||
}
|
||||
|
||||
public void actionPerformed(AnActionEvent e) {
|
||||
|
||||
Reference in New Issue
Block a user