/*
- * 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.
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);
}
/*
- * 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.
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;
import org.jetbrains.annotations.Nullable;
import javax.swing.*;
-import javax.swing.plaf.basic.ComboPopup;
import java.awt.*;
/**
public void setEnabled(boolean enable) {
if (enable == myComboBox.isEnabled()) return;
- myComboBox.setEnabled(enable);
+ UIUtil.setEnabled(myComponent, enable, true);
//myComboBox.setEditable(enable);
if (enable) {