开发者

how to run job after build project in eclipse RCP?

I need to run a job/workspaceJob after building project. I already have a code but it is not consistent. I need to finish the building because I need the updated file in my process.Here's my code:`

 private void doSomething(final ModelResource selected) throws Exception{
    WorkspaceJob doSomethingJob= new WorkspaceJob("doSomething") {
      @Override
      public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException {
        buildProject();
        return Status.OK_STATUS;
      }
    };
    doSomethingJob.addJobChangeListener(new Jo开发者_Python百科bChangeAdapter() {
      @Override
      public void done(IJobChangeEvent event) {
        Display.getDefault().asyncExec(new Runnable() {
          @Override
          public void run() {
            doThis();
          }
        });
      }
    });
    doSomethingJob.schedule();
  }

`

I did the code above but no luck. I am expecting doThis() to execute after the job is done but it building always comes last.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜