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.
精彩评论