summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2007-11-03 02:57:39 (EDT)
committerEike Stepper2007-11-03 02:57:39 (EDT)
commite87d1530b54082e7fa4b70620d86fe5da0316eb1 (patch)
tree4f72716d65bfe5b85ecc1e3dcba157a07f46916f
parent22aae482775d7d576a25435487650142f3157659 (diff)
downloadcdo-e87d1530b54082e7fa4b70620d86fe5da0316eb1.zip
cdo-e87d1530b54082e7fa4b70620d86fe5da0316eb1.tar.gz
cdo-e87d1530b54082e7fa4b70620d86fe5da0316eb1.tar.bz2
[208652] Add Preference Page for Weaver
https://bugs.eclipse.org/bugs/show_bug.cgi?id=208652
-rw-r--r--plugins/org.eclipse.emf.cdo.ui/plugin.xml2
-rw-r--r--plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/Sleeper.java63
2 files changed, 64 insertions, 1 deletions
diff --git a/plugins/org.eclipse.emf.cdo.ui/plugin.xml b/plugins/org.eclipse.emf.cdo.ui/plugin.xml
index 2b8e6b6..03bb96a 100644
--- a/plugins/org.eclipse.emf.cdo.ui/plugin.xml
+++ b/plugins/org.eclipse.emf.cdo.ui/plugin.xml
@@ -66,7 +66,7 @@
point="org.eclipse.ui.preferencePages">
<page
class="org.eclipse.emf.cdo.internal.ui.preferences.CDOPreferencePage"
- id="org.eclipse.emf.cdo.ui.preferences.CDOPreferencePage"
+ id="org.eclipse.emf.cdo.ui.CDOPreferencePage"
name="CDO">
</page>
</extension>
diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/Sleeper.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/Sleeper.java
new file mode 100644
index 0000000..18ca23e
--- /dev/null
+++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/Sleeper.java
@@ -0,0 +1,63 @@
+/***************************************************************************
+ * Copyright (c) 2004 - 2007 Eike Stepper, Germany.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ **************************************************************************/
+package org.eclipse.net4j.util.concurrent;
+
+/**
+ * @author Eike Stepper
+ */
+public class Sleeper
+{
+ private static final int DEFAULT_INTERVAL = 10;
+
+ private long start;
+
+ private int interval;
+
+ public Sleeper()
+ {
+ this(DEFAULT_INTERVAL);
+ }
+
+ public Sleeper(int interval)
+ {
+ this.interval = interval;
+ restart();
+ }
+
+ public int getInterval()
+ {
+ return interval;
+ }
+
+ public long getStart()
+ {
+ return start;
+ }
+
+ public void restart()
+ {
+ start = System.currentTimeMillis();
+ }
+
+ public void sleep(long millis)
+ {
+ while (System.currentTimeMillis() < start + millis)
+ {
+ ConcurrencyUtil.sleep(interval);
+ }
+ }
+
+ public void resleep(long millis)
+ {
+ restart();
+ sleep(millis);
+ }
+}