mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
update status bar progress only when there is progress (IDEA-88837)
This commit is contained in:
+13
-8
@@ -55,10 +55,7 @@ import java.awt.event.MouseAdapter;
|
||||
import java.awt.event.MouseEvent;
|
||||
import java.lang.ref.Reference;
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
|
||||
public class InfoAndProgressPanel extends JPanel implements CustomStatusBarWidget {
|
||||
private final ProcessPopup myPopup;
|
||||
@@ -635,11 +632,13 @@ public class InfoAndProgressPanel extends JPanel implements CustomStatusBarWidge
|
||||
private void runQuery() {
|
||||
if (getRootPane() == null) return;
|
||||
|
||||
synchronized (myOriginals) {
|
||||
for (InlineProgressIndicator each : myInline2Original.keySet()) {
|
||||
each.updateProgress();
|
||||
}
|
||||
Set<InlineProgressIndicator> indicators = getCurrentInlineIndicators();
|
||||
if (indicators.isEmpty()) return;
|
||||
|
||||
for (InlineProgressIndicator each : indicators) {
|
||||
each.updateProgress();
|
||||
}
|
||||
myQueryAlarm.cancelAllRequests();
|
||||
myQueryAlarm.addRequest(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
@@ -647,4 +646,10 @@ public class InfoAndProgressPanel extends JPanel implements CustomStatusBarWidge
|
||||
}
|
||||
}, 2000);
|
||||
}
|
||||
|
||||
private Set<InlineProgressIndicator> getCurrentInlineIndicators() {
|
||||
synchronized (myOriginals) {
|
||||
return myInline2Original.keySet();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user