mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
sometimes the usage view component is invisible, re-fixes IDEA-169722 "Analyze dependencies" bottom tree is empty
This commit is contained in:
@@ -28,7 +28,6 @@ import com.intellij.openapi.util.Disposer;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.usageView.UsageInfo;
|
||||
import com.intellij.usages.*;
|
||||
import com.intellij.usages.impl.UsageViewImpl;
|
||||
import com.intellij.util.Alarm;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -75,7 +74,6 @@ public abstract class UsagesPanel extends JPanel implements Disposable, DataProv
|
||||
UsageViewPresentation presentation = new UsageViewPresentation();
|
||||
presentation.setCodeUsagesString(getCodeUsagesString());
|
||||
myCurrentUsageView = UsageViewManager.getInstance(myProject).createUsageView(UsageTarget.EMPTY_ARRAY, usages, presentation, null);
|
||||
((UsageViewImpl)myCurrentUsageView).expandAll();
|
||||
setToComponent(myCurrentUsageView.getComponent());
|
||||
}
|
||||
catch (ProcessCanceledException e) {
|
||||
|
||||
@@ -249,7 +249,10 @@ public class UsageViewImpl implements UsageView {
|
||||
toolWindowPanel.setContent(myCentralPanel);
|
||||
|
||||
myTree.setCellRenderer(myUsageViewTreeCellRenderer);
|
||||
collapseAll();
|
||||
SwingUtilities.invokeLater(() -> {
|
||||
if (isDisposed || myProject.isDisposed()) return;
|
||||
collapseAll();
|
||||
});
|
||||
|
||||
myModelTracker.addListener(isPropertyChange-> {
|
||||
if (!isPropertyChange) {
|
||||
@@ -945,7 +948,7 @@ public class UsageViewImpl implements UsageView {
|
||||
void expandRoot() {
|
||||
ApplicationManager.getApplication().assertIsDispatchThread();
|
||||
fireEvents();
|
||||
myTree.expandPath(new TreePath(myTree.getModel().getRoot()));
|
||||
TreeUtil.expand(myTree, 1);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
Reference in New Issue
Block a user