another fix for IDEA-81337 breakpoint viewer condition field combo dropdown does not close

This commit is contained in:
Konstantin Bulenkov
2012-04-16 12:57:42 +02:00
parent 209c9ccc02
commit 275a6decbb
@@ -99,18 +99,21 @@ public class ComboBox extends ComboBoxWithWidePopup implements AWTEventListener
if (value != null) {
configureEditor(getEditor(), value);
IdeFocusManager.getGlobalInstance().requestFocus(ComboBox.this, true);
assert myJBPopup != null;
ComboBox.this.getUI().setPopupVisible(ComboBox.this, false);
myJBPopup.cancel();
}
}
})
.setFocusOwners(new Component[]{this})
.setMinSize(new Dimension(getWidth(), -1))
.setMovable(false)
.setResizable(false)
.createPopup();
list.setBorder(IdeBorderFactory.createEmptyBorder(0));
myJBPopup.showUnderneathOf(this);
list.addFocusListener(new FocusAdapter() {
@Override
public void focusLost(FocusEvent e) {
ComboBox.this.getUI().setPopupVisible(ComboBox.this, false);
myJBPopup.cancel();
}
});
@@ -167,8 +170,10 @@ public class ComboBox extends ComboBoxWithWidePopup implements AWTEventListener
public void removeNotify() {
super.removeNotify();
Toolkit.getDefaultToolkit().removeAWTEventListener(this);
if (myJBPopup != null && myJBPopup.isVisible()) {
if (myJBPopup != null) {
getUI().setPopupVisible(this, false);
myJBPopup.cancel();
}
}