mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IJPL-232707 refactor: collapse isProgressMode check
it is always true now GitOrigin-RevId: 49000da748271bd1a69dbee818ec73c2fa01f6e7
This commit is contained in:
committed by
intellij-monorepo-bot
parent
eed5a790b5
commit
f88e463d2e
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user