mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-08 06:39:38 +07:00
[file structure] thread safe detection if speed search is shown
GitOrigin-RevId: 47caffd6a331f519162e1225e20c9296f891d00c
This commit is contained in:
committed by
intellij-monorepo-bot
parent
a8f63974b2
commit
e7022d093d
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2021 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-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.ide.util;
|
||||
|
||||
import com.intellij.CommonBundle;
|
||||
@@ -74,7 +74,10 @@ import com.intellij.util.ui.TextTransferable;
|
||||
import com.intellij.util.ui.UIUtil;
|
||||
import com.intellij.util.ui.tree.TreeUtil;
|
||||
import com.intellij.xml.util.XmlStringUtil;
|
||||
import org.jetbrains.annotations.*;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.annotations.TestOnly;
|
||||
import org.jetbrains.concurrency.AsyncPromise;
|
||||
import org.jetbrains.concurrency.Promise;
|
||||
import org.jetbrains.concurrency.Promises;
|
||||
@@ -112,7 +115,7 @@ public class FileStructurePopup implements Disposable, TreeActionsOwner {
|
||||
|
||||
private final AsyncTreeModel myAsyncTreeModel;
|
||||
private final StructureTreeModel myStructureTreeModel;
|
||||
private final TreeSpeedSearch mySpeedSearch;
|
||||
private final MyTreeSpeedSearch mySpeedSearch;
|
||||
|
||||
private final Object myInitialElement;
|
||||
private final Map<Class, JBCheckBox> myCheckBoxes = new HashMap<>();
|
||||
@@ -961,11 +964,29 @@ public class FileStructurePopup implements Disposable, TreeActionsOwner {
|
||||
}
|
||||
|
||||
private class MyTreeSpeedSearch extends TreeSpeedSearch {
|
||||
private volatile boolean myPopupVisible;
|
||||
|
||||
MyTreeSpeedSearch() {
|
||||
super(myTree, path -> getSpeedSearchText(TreeUtil.getLastUserObject(path)), true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showPopup(String searchText) {
|
||||
super.showPopup(searchText);
|
||||
myPopupVisible = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void hidePopup() {
|
||||
super.hidePopup();
|
||||
myPopupVisible = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isPopupActive() {
|
||||
return myPopupVisible;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Point getComponentLocationOnScreen() {
|
||||
return myPopup.getContent().getLocationOnScreen();
|
||||
|
||||
Reference in New Issue
Block a user