Package org.eclipse.jface.dialogs

Examples of org.eclipse.jface.dialogs.ProgressMonitorDialog


        });

        // join wga distribution download if present
        Job[] jobs = Job.getJobManager().find(WGADesignerPlugin.JOB_FAMILY_WGA_DISTRIBUTION_DOWNLOAD);
        if (jobs != null && jobs.length > 0) {
            ProgressMonitorDialog dialog = new ProgressMonitorDialog(getShell());
            IRunnableWithProgress runnable = new IRunnableWithProgress() {
                public void run(IProgressMonitor arg0) throws InvocationTargetException, InterruptedException {
                    Job.getJobManager().join(WGADesignerPlugin.JOB_FAMILY_WGA_DISTRIBUTION_DOWNLOAD, arg0);
                }
            };
            try {
                dialog.run(true, true, runnable);
            }
            catch (InvocationTargetException e) {
            }
            catch (InterruptedException e) {
            }
View Full Code Here


  @Override
  protected boolean innerPerformFinish() {

    try {

      ProgressMonitorDialog progressMonitor = new ProgressMonitorDialog(getShell());
      progressMonitor.open();
     
      progressMonitor.run(true, true, new UploadRunable(_serverPage.getSelectedServers()));
     
      List<String> serverNames = new ArrayList<String>();
      Iterator<WGARemoteServer> remoteServers = _serverPage.getSelectedServers().iterator();
      while(remoteServers.hasNext()){
        WGARemoteServer current = remoteServers.next();
View Full Code Here

      }
    };
   
    try {
      if (shell != null) {
        ProgressMonitorDialog dialog = new ProgressMonitorDialog(shell);
        dialog.run(true, true, runnable);
      } else {
        Job job = new Job("validation") {

          @Override
          protected IStatus run(IProgressMonitor monitor) {
View Full Code Here

            }
   
          };
        }
        try {
          new ProgressMonitorDialog(getShell()).run(true, true, runnable);
          _model.refresh(WGADesignerPlugin.getDefault().getWGADeploymentManager().getDeployments());
        } catch (Exception e) {
          WGADesignerPlugin.getDefault().logError("Unable to create wga deployment.", e);
        }
      }
View Full Code Here

                throw new InterruptedException(e.getMessage());
              }
            }
          };
          try {
            new ProgressMonitorDialog(getShell()).run(true, true, runnable);
          } catch (Exception e) {
            WGADesignerPlugin.getDefault().logError("Unable to remove wga deployment.", e);
          }         
          _model.refresh(WGADesignerPlugin.getDefault().getWGADeploymentManager().getDeployments());
        }
View Full Code Here

            }
   
          };
        }
        try {
          new ProgressMonitorDialog(getShell()).run(true, true, runnable);
        } catch (Exception e) {
          WGADesignerPlugin.getDefault().logError("Unable to update wga deployment.", e);
        }
      }
      _model.refresh(WGADesignerPlugin.getDefault().getWGADeploymentManager().getDeployments());   
View Full Code Here

      job.setPriority(Job.SHORT);
      job.schedule();
    }
   
    if (joinAndWaitForStartup) {     
        ProgressMonitorDialog dialog = new ProgressMonitorDialog(Display.getCurrent().getActiveShell());
        try {
                dialog.run(true, true, new WaitTask());
            }
            catch (InvocationTargetException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
View Full Code Here

  private NewsCounter countAll() {
    final NewsCounter newsCounter = new NewsCounter();
    final long start = System.currentTimeMillis();
    final Collection<IFeed> feeds = DynamicDAO.loadAll(IFeed.class);

    final ProgressMonitorDialog dialog = new NewsServiceProgressMonitorDialog(new Shell(Display.getDefault(), SWT.NONE));
    dialog.setOpenOnRun(false);

    /* Runnable will open the Dialog after SHOW_PROGRESS_THRESHOLD ms */
    IRunnableWithProgress runnable = new IRunnableWithProgress() {
      private boolean fDialogOpened;

      public void run(IProgressMonitor monitor) {
        int worked = 0;
        for (IFeed feed : feeds) {
          newsCounter.put(feed.getLink(), count(feed));

          /* Open the Dialog if exceeded SHOW_PROGRESS_THRESHOLD ms */
          if (System.currentTimeMillis() - start > SHOW_PROGRESS_THRESHOLD && !fDialogOpened) {
            dialog.open();
            monitor.beginTask("RSSOwl was not shutdown properly. Restoring data, please wait...", feeds.size() - worked);
            fDialogOpened = true;
          }

          /* Worked a bit again... */
          if (fDialogOpened)
            monitor.worked(1);

          /* Remember the worked items */
          worked++;
        }

        /* Completed */
        monitor.done();
      }
    };

    /* Execute the Runnable */
    try {
      dialog.run(false, false, runnable);
    } catch (InvocationTargetException e) {
      Activator.getDefault().logError(e.getMessage(), e);
    } catch (InterruptedException e) {
      Activator.getDefault().logError(e.getMessage(), e);
    }
View Full Code Here

  }

  private void startCore() {

    /* Dialog to show progress */
    final ProgressMonitorDialog dialog = new ProgressMonitorDialog(new Shell(Display.getDefault())) {
      @Override
      protected Point getInitialLocation(Point initialSize) {
        Rectangle displayBounds = getParentShell().getDisplay().getPrimaryMonitor().getBounds();
        Point shellSize = getInitialSize();
        int x = displayBounds.x + (displayBounds.width - shellSize.x) >> 1;
        int y = displayBounds.y + (displayBounds.height - shellSize.y) >> 1;

        return new Point(x, y);
      }
    };
    dialog.setOpenOnRun(false);

    /* Runnable to start core */
    IRunnableWithProgress runnable = new IRunnableWithProgress() {
      public void run(IProgressMonitor monitor) {
        LongOperationMonitor callbackMonitor = new LongOperationMonitor(monitor) {
          @Override
          public void beginLongOperation() {
            Display.getDefault().syncExec(new Runnable() {
              public void run() {
                dialog.open();
              }
            });
          }
        };

        /* Start Core */
        InternalOwl.getDefault().startup(callbackMonitor);
      }
    };

    /* Execute the Runnable */
    try {
      dialog.run(false, false, runnable);
    } catch (InvocationTargetException e) {
      Activator.getDefault().logError(e.getMessage(), e);
    } catch (InterruptedException e) {
      Activator.getDefault().logError(e.getMessage(), e);
    }
View Full Code Here

    /* Progress Dialog */
    Shell shell = fShell;
    if (shell == null)
      shell = OwlUI.getActiveShell();

    ProgressMonitorDialog dialog = new ProgressMonitorDialog(shell) {
      @Override
      protected void initializeBounds() {
        super.initializeBounds();

        /* Size */
        Shell shell = getShell();
        int width = convertHorizontalDLUsToPixels(OwlUI.MIN_DIALOG_WIDTH_DLU);
        shell.setSize(width, shell.getSize().y);

        /* New Location */
        Rectangle containerBounds = shell.getParent().getBounds();
        int x = Math.max(0, containerBounds.x + (containerBounds.width - width) / 2);
        shell.setLocation(x, shell.getLocation().y);
      }
    };

    /* Open and Run */
    try {
      dialog.run(true, false, runnableWithProgress);
    } catch (InvocationTargetException e) {
      Activator.safeLogError(e.getMessage(), e);
    } catch (InterruptedException e) {
      Activator.safeLogError(e.getMessage(), e);
    }
View Full Code Here

TOP

Related Classes of org.eclipse.jface.dialogs.ProgressMonitorDialog

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.