- try {
- CompilePGraphs.compilePGraphs((Resource) target, new CompileUserAgent());
- } catch (IOException | DatabaseException e) {
- ExceptionUtils.logAndShowError(e);
- }
+ Job job = new Job("Compile PGraphs") {
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ try {
+ CompilePGraphs.compilePGraphs((Resource) target, new CompileUserAgent(), monitor);
+ return Status.OK_STATUS;
+ } catch (IOException | DatabaseException e) {
+ ExceptionUtils.logAndShowError(e);
+ return new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.getMessage());
+ } finally {
+ monitor.done();
+ }
+ }
+ };
+ job.schedule();