mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
fix leak in SearchTextField IDEA-273465
GitOrigin-RevId: e5e29ca1dba274677d35113ef96701e25c3544dc
This commit is contained in:
committed by
intellij-monorepo-bot
parent
60a8e34003
commit
dc01e16f93
@@ -44,6 +44,7 @@ public class SearchTextField extends JPanel {
|
||||
private JBPopup myPopup;
|
||||
private String myHistoryPropertyName;
|
||||
private final boolean historyPopupEnabled;
|
||||
private boolean init = true;
|
||||
|
||||
public SearchTextField() {
|
||||
this(true);
|
||||
@@ -152,6 +153,7 @@ public class SearchTextField extends JPanel {
|
||||
DumbAwareAction.create(event -> {
|
||||
showPopup();
|
||||
}).registerCustomShortcutSet(KeymapUtil.getActiveKeymapShortcuts("ShowSearchHistory"), myTextField);
|
||||
init = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -378,14 +380,16 @@ public class SearchTextField extends JPanel {
|
||||
}
|
||||
|
||||
private void reInitPopup() {
|
||||
hidePopup();
|
||||
final JList<String> list = new JBList<>(myModel);
|
||||
final Runnable chooseRunnable = createItemChosenCallback(list);
|
||||
if(ApplicationManager.getApplication() != null && JBPopupFactory.getInstance() != null) {
|
||||
myPopup = JBPopupFactory.getInstance().createListPopupBuilder(list)
|
||||
.setMovable(false)
|
||||
.setRequestFocus(true)
|
||||
.setItemChoosenCallback(chooseRunnable).createPopup();
|
||||
if(!init) {
|
||||
hidePopup();
|
||||
final JList<String> list = new JBList<>(myModel);
|
||||
final Runnable chooseRunnable = createItemChosenCallback(list);
|
||||
if (ApplicationManager.getApplication() != null && JBPopupFactory.getInstance() != null) {
|
||||
myPopup = JBPopupFactory.getInstance().createListPopupBuilder(list)
|
||||
.setMovable(false)
|
||||
.setRequestFocus(true)
|
||||
.setItemChoosenCallback(chooseRunnable).createPopup();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user