Hello!
Try this script, it should get the job done. Modify the construct method as required.
It can be canceled as well. Good luck!
import com.eviware.soapui.support.UISupport;
import com.eviware.x.dialogs.XProgressMonitor;
import com.eviware.x.dialogs.Worker.WorkerAdapter;
class MyWorker extends WorkerAdapter {
Thread current;
boolean running = true;
Object construct(XProgressMonitor mon) {
current = Thread.currentThread();
for(int i=0; i<=5; i++) {
mon.setProgress(i, ""+i);
try {
Thread.sleep(1000);
} catch(InterruptedException e) {
}
if(!running) return null;
}
return null;
}
boolean onCancel() {
running = false;
if(current != null) current.interrupt();
return true;
}
}
def p = UISupport.getDialogs().createProgressDialog("label", 5, "init", true);
p.run(new MyWorker());
/Dain
eviware support