eclipse RCP进度条显示

public class ProcessControl {
    public static void execute(final String filepath) {
         ProgressMonitorDialog progress = new ProgressMonitorDialog(null);
         try {
             progress.run(true, false, new IRunnableWithProgress() {
                 public void run(IProgressMonitor monitor) throws InvocationTargetException,    InterruptedException {
                     monitor.beginTask("正在转换文件", IProgressMonitor.UNKNOWN);
                     monitor.setTaskName("转换文件");
                    //执行程序
                     String s = filepath;
          //程序结束  
for(int i=0;i<1000000;i++){ System.out.println(s+"1"); } monitor.done(); } }); } catch (InvocationTargetException e) { e.printStackTrace(); } catch (InterruptedException e) { e.printStackTrace(); } } }

 

posted @ 2012-12-28 15:52  裴松年  阅读(795)  评论(0编辑  收藏  举报