org.symbian.tools.mtw.ui/src/org/symbian/tools/tmw/internal/util/DelegateRunnable.java
changeset 466 129c94e78375
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.symbian.tools.mtw.ui/src/org/symbian/tools/tmw/internal/util/DelegateRunnable.java	Tue Aug 17 13:40:28 2010 -0700
@@ -0,0 +1,43 @@
+/**
+ * Copyright (c) 2010 Symbian Foundation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the License "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Symbian Foundation - initial contribution.
+ * Contributors:
+ * Description:
+ * Overview:
+ * Details:
+ * Platforms/Drives/Compatibility:
+ * Assumptions/Requirement/Pre-requisites:
+ * Failures and causes:
+ */
+package org.symbian.tools.tmw.internal.util;
+
+import java.lang.reflect.InvocationTargetException;
+import java.util.Collection;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.SubProgressMonitor;
+import org.eclipse.jface.operation.IRunnableWithProgress;
+
+public class DelegateRunnable implements IRunnableWithProgress {
+    private final Collection<IRunnableWithProgress> runnables;
+
+    public DelegateRunnable(Collection<IRunnableWithProgress> runnables) {
+        this.runnables = runnables;
+    }
+
+    public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
+        monitor.beginTask("Preparing project", runnables.size() * 20);
+        for (IRunnableWithProgress runnable : runnables) {
+            runnable.run(new SubProgressMonitor(monitor, 20));
+        }
+        monitor.done();
+    }
+
+}