Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Valenta2004-09-07 19:23:34 +0000
committerMichael Valenta2004-09-07 19:23:34 +0000
commit46a4b8a4abad29a40fa3c009887ece204efef314 (patch)
tree4a78e201ed00067ca356ff2024ec348c493b92d6
parent1f359dfa3811d52d0c3a75930f763ac6fec2fafb (diff)
downloadeclipse.platform.team-46a4b8a4abad29a40fa3c009887ece204efef314.tar.gz
eclipse.platform.team-46a4b8a4abad29a40fa3c009887ece204efef314.tar.xz
eclipse.platform.team-46a4b8a4abad29a40fa3c009887ece204efef314.zip
Introduced some methods on BackgroundEventandler to give sublcasses
control of dispatch delay.
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/BackgroundEventHandler.java25
1 files changed, 23 insertions, 2 deletions
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/BackgroundEventHandler.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/BackgroundEventHandler.java
index 6a15b3c3f..eed8bbf48 100644
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/BackgroundEventHandler.java
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/BackgroundEventHandler.java
@@ -330,8 +330,8 @@ public abstract class BackgroundEventHandler {
*/
protected boolean isReadyForDispatch(boolean wait) {
long duration = System.currentTimeMillis() - timeOfLastDispatch;
- if((dispatchCount < DISPATCH_THRESHOLD && duration >= DISPATCH_DELAY) ||
- duration >= LONG_DISPATCH_DELAY) {
+ if((dispatchCount < DISPATCH_THRESHOLD && duration >= getShortDispatchDelay()) ||
+ duration >= getLongDispatchDelay()) {
return true;
}
synchronized(this) {
@@ -347,7 +347,28 @@ public abstract class BackgroundEventHandler {
return isQueueEmpty();
}
+ /**
+ * Return the value that is used to determine how often
+ * the events are dispatched (i.e. how often the UI is
+ * updated) for the first 3 cycles. The default value is 1.5 seconds.
+ * After the first 3 cycles, a longer delay is used
+ * @return the dispatch delay used for the first 3 cycles.
+ */
+ protected long getShortDispatchDelay() {
+ return DISPATCH_DELAY;
+ }
+
/**
+ * Return the value that is used to determine how often
+ * the events are dispatched (i.e. how often the UI is
+ * updated) after the first 3 cycles. The default value is 10 seconds.
+ * @return the dispatch delay used after the first 3 cycles.
+ */
+ protected long getLongDispatchDelay() {
+ return LONG_DISPATCH_DELAY;
+ }
+
+ /**
* Handle the exception by recording it in the errors list.
* @param e
*/

Back to the top