Exemplo n.º 1
0
 @Override
 public IStatus runInUIThread(DBRProgressMonitor monitor) {
   /*
           if (mainMonitor.isCanceled()) {
               // Try to cancel current load service
               try {
                   loadService.cancel();
               }
               catch (InvocationTargetException e) {
                   log.warn("Error while canceling service", e.getTargetException());
               }
               return Status.CANCEL_STATUS;
           } else {
   */
   if (!visualizer.isCompleted()) {
     visualizer.visualizeLoading();
     schedule(DELAY);
   }
   // }
   return Status.OK_STATUS;
 }
Exemplo n.º 2
0
  private IStatus run(DBRProgressMonitor monitor, boolean lazy) {
    monitor = visualizer.overwriteMonitor(monitor);

    LoadingUIJob<RESULT> updateUIJob = new LoadingUIJob<>(this, monitor);
    updateUIJob.schedule();
    this.loadingService.setProgressMonitor(monitor);
    Throwable error = null;
    RESULT result = null;
    try {
      result = this.loadingService.evaluate();
    } catch (InvocationTargetException e) {
      //            log.error(e.getTargetException());
      error = e.getTargetException();
    } catch (InterruptedException e) {
      return new Status(Status.CANCEL, DBeaverCore.PLUGIN_ID, "Loading interrupted");
    } finally {
      UIUtils.runInUI(null, new LoadFinisher(result, error));
    }
    return Status.OK_STATUS;
  }