Eclipse版本:3.6.2
Content
1、使用Job对象
2、使用IRunnableWithProgress接口
1、Job对象
org.eclipse.core.runtime.jobs.Job.Job,提供了一种可视化的任务接口,它默认有一个进度条。
使用方法:
Job job = new Job( "My Job") {
@Override
protected IStatus run(IProgressMonitor monitor) {
// set total number of work units
monitor.beginTask( "Doing something time consuming here", 100);
for (int i = 0; i < 5; i++) {