disable language switcher together with the expression editor

This commit is contained in:
Egor.Ushakov
2016-02-11 18:43:07 +03:00
parent 4a77373e94
commit 8748556c8c
2 changed files with 15 additions and 12 deletions
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2015 JetBrains s.r.o.
* Copyright 2000-2016 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.
@@ -82,16 +82,19 @@ public abstract class XDebuggerEditorBase {
new ClickListener() {
@Override
public boolean onClick(@NotNull MouseEvent e, int clickCount) {
ListPopup oldPopup = SoftReference.dereference(myPopup);
if (oldPopup != null && !oldPopup.isDisposed()) {
oldPopup.cancel();
myPopup = null;
if (myChooseFactory.isEnabled()) {
ListPopup oldPopup = SoftReference.dereference(myPopup);
if (oldPopup != null && !oldPopup.isDisposed()) {
oldPopup.cancel();
myPopup = null;
return true;
}
ListPopup popup = createLanguagePopup();
popup.showUnderneathOf(myChooseFactory);
myPopup = new WeakReference<ListPopup>(popup);
return true;
}
ListPopup popup = createLanguagePopup();
popup.showUnderneathOf(myChooseFactory);
myPopup = new WeakReference<ListPopup>(popup);
return true;
return false;
}
}.installOn(myChooseFactory);
}
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2015 JetBrains s.r.o.
* Copyright 2000-2016 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.
@@ -22,6 +22,7 @@ import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.ComboBox;
import com.intellij.ui.EditorComboBoxEditor;
import com.intellij.ui.EditorComboBoxRenderer;
import com.intellij.util.ui.UIUtil;
import com.intellij.xdebugger.XExpression;
import com.intellij.xdebugger.XSourcePosition;
import com.intellij.xdebugger.evaluation.EvaluationMode;
@@ -33,7 +34,6 @@ import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import javax.swing.*;
import javax.swing.plaf.basic.ComboPopup;
import java.awt.*;
/**
@@ -80,7 +80,7 @@ public class XDebuggerExpressionComboBox extends XDebuggerEditorBase {
public void setEnabled(boolean enable) {
if (enable == myComboBox.isEnabled()) return;
myComboBox.setEnabled(enable);
UIUtil.setEnabled(myComponent, enable, true);
//myComboBox.setEditable(enable);
if (enable) {