From f88e463d2ebb094230ea1d1d02154f93c6cfe3e1 Mon Sep 17 00:00:00 2001 From: Vadim Salavatov Date: Wed, 11 Feb 2026 17:56:49 +0100 Subject: [PATCH] IJPL-232707 refactor: collapse isProgressMode check it is always true now GitOrigin-RevId: 49000da748271bd1a69dbee818ec73c2fa01f6e7 --- .../ide/plugins/newui/SearchResultPanel.java | 45 +++++-------------- 1 file changed, 10 insertions(+), 35 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/ide/plugins/newui/SearchResultPanel.java b/platform/platform-impl/src/com/intellij/ide/plugins/newui/SearchResultPanel.java index 29d27202d502..fe47618c4026 100644 --- a/platform/platform-impl/src/com/intellij/ide/plugins/newui/SearchResultPanel.java +++ b/platform/platform-impl/src/com/intellij/ide/plugins/newui/SearchResultPanel.java @@ -49,9 +49,7 @@ public abstract class SearchResultPanel { setEmptyText(""); - if (isProgressMode()) { - loading(false); - } + loading(false); } public @NotNull PluginsGroupComponent getPanel() { @@ -65,9 +63,7 @@ public abstract class SearchResultPanel { public @NotNull JComponent createScrollPane() { JBScrollPane pane = new JBScrollPane(myPanel); pane.setBorder(JBUI.Borders.empty()); - if (isProgressMode()) { - myVerticalScrollBar = pane.getVerticalScrollBar(); - } + myVerticalScrollBar = pane.getVerticalScrollBar(); return pane; } @@ -118,29 +114,14 @@ public abstract class SearchResultPanel { } private void handleQuery(@NotNull String query) { - if (isProgressMode()) { - loading(true); + loading(true); - AtomicBoolean runQuery = myRunQuery = new AtomicBoolean(true); - PluginsGroup group = myGroup; + AtomicBoolean runQuery = myRunQuery = new AtomicBoolean(true); + PluginsGroup group = myGroup; - ApplicationManager.getApplication().executeOnPooledThread(() -> { - handleQuery(query, group, runQuery); - }); - } - else { - handleQuery(query, myGroup, null); - - if (!myGroup.getDescriptors().isEmpty()) { - myPanel.addGroup(myGroup); - myGroup.titleWithCount(); - myPanel.initialSelection(false); - } - - announceSearchResultsWithDelay(); - runPostFillGroupCallback(); - fullRepaint(); - } + ApplicationManager.getApplication().executeOnPooledThread(() -> { + handleQuery(query, group, runQuery); + }); } protected void updatePanel(AtomicBoolean runQuery) { @@ -182,7 +163,7 @@ public abstract class SearchResultPanel { } private void loading(boolean start) { - PluginsGroupComponentWithProgress panel = (PluginsGroupComponentWithProgress)myPanel; + PluginsGroupComponentWithProgress panel = myPanel; if (start) { isLoading = true; panel.showLoadingIcon(); @@ -194,18 +175,12 @@ public abstract class SearchResultPanel { } public void dispose() { - if (isProgressMode()) { - ((PluginsGroupComponentWithProgress)myPanel).dispose(); - } + myPanel.dispose(); if (myAnnounceSearchResultsAlarm != null) { Disposer.dispose(myAnnounceSearchResultsAlarm); } } - private boolean isProgressMode() { - return myPanel instanceof PluginsGroupComponentWithProgress; - } - public void removeGroup() { if (myGroup.ui != null) { myPanel.removeGroup(myGroup);