filter component: avoid deprecated api

GitOrigin-RevId: 210fed10276364c0fff23060e2f1fd9a5095c0f1
This commit is contained in:
Bas Leijdekkers
2020-06-08 17:25:53 +03:00
committed by intellij-monorepo-bot
parent 8409c605ff
commit dee1374b40
@@ -1,4 +1,4 @@
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.ui;
import com.intellij.openapi.application.ModalityState;
@@ -16,7 +16,7 @@ import java.awt.event.KeyEvent;
import java.util.List;
public abstract class FilterComponent extends JPanel {
private final SearchTextFieldWithStoredHistory myFilter;
private final SearchTextField myFilter;
private final Alarm myUpdateAlarm = new Alarm();
private final boolean myOnTheFly;
@@ -27,7 +27,7 @@ public abstract class FilterComponent extends JPanel {
public FilterComponent(@NonNls String propertyName, int historySize, boolean onTheFlyUpdate) {
super(new BorderLayout());
myOnTheFly = onTheFlyUpdate;
myFilter = new SearchTextFieldWithStoredHistory(propertyName) {
myFilter = new SearchTextField(propertyName) {
@Override
protected Runnable createItemChosenCallback(JList list) {
final Runnable callback = super.createItemChosenCallback(list);
@@ -41,12 +41,6 @@ public abstract class FilterComponent extends JPanel {
protected Component getPopupLocationComponent() {
return FilterComponent.this.getPopupLocationComponent();
}
@Override
protected void onFocusLost() {
addCurrentTextToHistory();
super.onFocusLost();
}
};
myFilter.getTextEditor().addKeyListener(new KeyAdapter() {
//to consume enter in combo box - do not process this event by default button from DialogWrapper