IDEA-CR-47180: combobox: install key listener for custom editors

Previously, key listeners were installed for default editors only. And unregistered if combobox.setEditor(myEditor) was called.

(cherry picked from commit d2e805ed4ce83d6a38323dcd3dc9b2ebe1bfec67)

GitOrigin-RevId: 8fec1dc06ebea24f477c0fe318d1c3bc880d876b
This commit is contained in:
Sergey Simonchik
2019-05-15 14:06:13 +03:00
committed by intellij-monorepo-bot
parent e26683f4e9
commit 94d548f7ff
2 changed files with 2 additions and 2 deletions
@@ -358,7 +358,6 @@ public class DarculaComboBoxUI extends BasicComboBoxUI implements Border, ErrorB
tf.setColumns(0);
}
installEditorKeyListener(comboBoxEditor);
return comboBoxEditor;
}
@@ -509,6 +508,7 @@ public class DarculaComboBoxUI extends BasicComboBoxUI implements Border, ErrorB
protected void configureEditor() {
super.configureEditor();
installEditorKeyListener(comboBox.getEditor());
if (editor instanceof JComponent) {
JComponent jEditor = (JComponent)editor;
jEditor.setOpaque(false);
@@ -334,7 +334,6 @@ public class WinIntelliJComboBoxUI extends DarculaComboBoxUI {
}
};
installEditorKeyListener(comboBoxEditor);
return comboBoxEditor;
}
@@ -342,6 +341,7 @@ public class WinIntelliJComboBoxUI extends DarculaComboBoxUI {
protected void configureEditor() {
super.configureEditor();
installEditorKeyListener(comboBox.getEditor());
if (editor instanceof JComponent) {
JComponent jEditor = (JComponent)editor;
jEditor.setBorder(DEFAULT_EDITOR_BORDER);