update status bar progress only when there is progress (IDEA-88837)

This commit is contained in:
peter
2012-09-06 12:56:59 +02:00
parent 9ef874bb91
commit c4c5d9cb84
@@ -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();
}
}
}