summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2007-07-29 09:28:47 (EDT)
committerEike Stepper2007-07-29 09:28:47 (EDT)
commit4eccf9308d4957c5fead0affca89038b31002650 (patch)
treea98832165c8ca818092d74185b53075a6e371ed7
parent1608f35e31c8ae93bab04434ece7bdee35eb3246 (diff)
downloadcdo-4eccf9308d4957c5fead0affca89038b31002650.zip
cdo-4eccf9308d4957c5fead0affca89038b31002650.tar.gz
cdo-4eccf9308d4957c5fead0affca89038b31002650.tar.bz2
*** empty log message ***
-rw-r--r--plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/om/monitor/EclipseSubMonitor.java31
-rw-r--r--plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/om/monitor/LegacySubMonitor.java18
-rw-r--r--plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/om/monitor/Monitor.java2
-rw-r--r--plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/om/monitor/RootMonitor.java11
-rw-r--r--plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/om/monitor/SubMonitor.java2
-rw-r--r--plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/om/monitor/EclipseMonitor.java19
-rw-r--r--plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/om/monitor/IEclipseMonitor.java21
-rw-r--r--plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/om/monitor/LegacyMonitor.java19
-rw-r--r--plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/om/monitor/MONITOR.java2
9 files changed, 112 insertions, 13 deletions
diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/om/monitor/EclipseSubMonitor.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/om/monitor/EclipseSubMonitor.java
new file mode 100644
index 0000000..991bf56
--- /dev/null
+++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/om/monitor/EclipseSubMonitor.java
@@ -0,0 +1,31 @@
+package org.eclipse.net4j.internal.util.om.monitor;
+
+import org.eclipse.net4j.util.om.monitor.IEclipseMonitor;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.SubProgressMonitor;
+
+/**
+ * @author Eike Stepper
+ */
+public final class EclipseSubMonitor extends SubMonitor implements IEclipseMonitor
+{
+ private IProgressMonitor progressMonitor;
+
+ public EclipseSubMonitor(Monitor parent, int workFromParent)
+ {
+ super(parent, workFromParent);
+ progressMonitor = new SubProgressMonitor(((IEclipseMonitor)parent).getProgressMonitor(), workFromParent);
+ }
+
+ public IProgressMonitor getProgressMonitor()
+ {
+ return progressMonitor;
+ }
+
+ @Override
+ public SubMonitor newSubMonitor(int workFromParent)
+ {
+ return new EclipseSubMonitor(this, workFromParent);
+ }
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/om/monitor/LegacySubMonitor.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/om/monitor/LegacySubMonitor.java
new file mode 100644
index 0000000..b7cd3b5
--- /dev/null
+++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/om/monitor/LegacySubMonitor.java
@@ -0,0 +1,18 @@
+package org.eclipse.net4j.internal.util.om.monitor;
+
+/**
+ * @author Eike Stepper
+ */
+public final class LegacySubMonitor extends SubMonitor
+{
+ public LegacySubMonitor(Monitor parent, int workFromParent)
+ {
+ super(parent, workFromParent);
+ }
+
+ @Override
+ public SubMonitor newSubMonitor(int workFromParent)
+ {
+ return new LegacySubMonitor(this, workFromParent);
+ }
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/om/monitor/Monitor.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/om/monitor/Monitor.java
index fa55f86..929afea 100644
--- a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/om/monitor/Monitor.java
+++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/om/monitor/Monitor.java
@@ -69,4 +69,6 @@ public abstract class Monitor
}
public abstract void message(String msg, int level);
+
+ public abstract SubMonitor newSubMonitor(int workFromParent);
} \ No newline at end of file
diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/om/monitor/RootMonitor.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/om/monitor/RootMonitor.java
index 58e1517..6e00037 100644
--- a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/om/monitor/RootMonitor.java
+++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/om/monitor/RootMonitor.java
@@ -18,15 +18,4 @@ public abstract class RootMonitor extends Monitor
public RootMonitor()
{
}
-
- @Override
- public void message(String msg, int level)
- {
- for (int i = 0; i < level; i++)
- {
- System.out.print(" ");
- }
-
- System.out.println(msg);
- }
}
diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/om/monitor/SubMonitor.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/om/monitor/SubMonitor.java
index 3781c78..75d395a 100644
--- a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/om/monitor/SubMonitor.java
+++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/om/monitor/SubMonitor.java
@@ -3,7 +3,7 @@ package org.eclipse.net4j.internal.util.om.monitor;
/**
* @author Eike Stepper
*/
-public class SubMonitor extends Monitor
+public abstract class SubMonitor extends Monitor
{
private Monitor parent;
diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/om/monitor/EclipseMonitor.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/om/monitor/EclipseMonitor.java
index 663e5df..0a652d7 100644
--- a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/om/monitor/EclipseMonitor.java
+++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/om/monitor/EclipseMonitor.java
@@ -10,7 +10,9 @@
**************************************************************************/
package org.eclipse.net4j.util.om.monitor;
+import org.eclipse.net4j.internal.util.om.monitor.EclipseSubMonitor;
import org.eclipse.net4j.internal.util.om.monitor.RootMonitor;
+import org.eclipse.net4j.internal.util.om.monitor.SubMonitor;
import org.eclipse.core.runtime.IProgressMonitor;
@@ -31,6 +33,23 @@ public final class EclipseMonitor extends RootMonitor
return progressMonitor;
}
+ @Override
+ public SubMonitor newSubMonitor(int workFromParent)
+ {
+ return new EclipseSubMonitor(this, workFromParent);
+ }
+
+ @Override
+ public void message(String msg, int level)
+ {
+ for (int i = 0; i < level; i++)
+ {
+ System.out.print(" ");
+ }
+
+ System.out.println(msg);
+ }
+
public static void startMonitoring(IProgressMonitor progressMonitor)
{
MONITOR.startMonitoring(new EclipseMonitor(progressMonitor));
diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/om/monitor/IEclipseMonitor.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/om/monitor/IEclipseMonitor.java
new file mode 100644
index 0000000..fb0e69e
--- /dev/null
+++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/om/monitor/IEclipseMonitor.java
@@ -0,0 +1,21 @@
+/***************************************************************************
+ * 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.om.monitor;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+
+/**
+ * @author Eike Stepper
+ */
+public interface IEclipseMonitor
+{
+ public IProgressMonitor getProgressMonitor();
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/om/monitor/LegacyMonitor.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/om/monitor/LegacyMonitor.java
index f9ecf7f..d9091ad 100644
--- a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/om/monitor/LegacyMonitor.java
+++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/om/monitor/LegacyMonitor.java
@@ -10,7 +10,9 @@
**************************************************************************/
package org.eclipse.net4j.util.om.monitor;
+import org.eclipse.net4j.internal.util.om.monitor.LegacySubMonitor;
import org.eclipse.net4j.internal.util.om.monitor.RootMonitor;
+import org.eclipse.net4j.internal.util.om.monitor.SubMonitor;
/**
* @author Eike Stepper
@@ -21,6 +23,23 @@ public final class LegacyMonitor extends RootMonitor
{
}
+ @Override
+ public SubMonitor newSubMonitor(int workFromParent)
+ {
+ return new LegacySubMonitor(this, workFromParent);
+ }
+
+ @Override
+ public void message(String msg, int level)
+ {
+ for (int i = 0; i < level; i++)
+ {
+ System.out.print(" ");
+ }
+
+ System.out.println(msg);
+ }
+
public static void startMonitoring()
{
MONITOR.startMonitoring(new LegacyMonitor());
diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/om/monitor/MONITOR.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/om/monitor/MONITOR.java
index 18da473..62d1a34 100644
--- a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/om/monitor/MONITOR.java
+++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/om/monitor/MONITOR.java
@@ -99,7 +99,7 @@ public final class MONITOR
return;
}
- SubMonitor subMonitor = new SubMonitor(monitor, workFromParent);
+ SubMonitor subMonitor = monitor.newSubMonitor(workFromParent);
CURRENT.set(subMonitor);
try