@@ -0,0 +1,979 @@
+package md.frolov.legume.client.util;%0A%0Aimport java.util.Iterator;%0A%0Aimport com.google.gwt.core.client.Scheduler;%0A%0A/** @author Ivan Frolov (ifrolov@tacitknowledge.com) */%0Apublic abstract class IteratorIncrementalTask%3CT%3E implements Scheduler.RepeatingCommand%0A%7B%0A    private final Iterator%3CT%3E collection;%0A    private boolean started = false;%0A%0A    protected IteratorIncrementalTask(final Iterable%3CT%3E collection)%0A    %7B%0A        this.collection = collection.iterator();%0A    %7D%0A%0A    @Override%0A    public final boolean execute()%0A    %7B%0A        if(!started) %7B%0A            beforeAll();%0A            started = true;%0A        %7D%0A%0A        if (collection.hasNext())%0A        %7B%0A            T obj = collection.next();%0A            iterate(obj);%0A        %7D%0A%0A        if (!collection.hasNext())%0A        %7B%0A            afterAll();%0A        %7D%0A%0A        return collection.hasNext();%0A    %7D%0A%0A    public abstract void iterate(T obj);%0A%0A    public void beforeAll()%0A    %7B%0A    %7D%0A%0A    public void afterAll()%0A    %7B%0A    %7D%0A%7D%0A%0A

Add Base class for long operations.