Package org.xnap.commons.gui

Examples of org.xnap.commons.gui.ProgressDialog


      throw new RuntimeException("Concurrent job invocation");
    }
   
    final Object[] retSuccess = new Object[1];
    final Throwable[] ret = new Exception[1];
    final ProgressDialog dialog;
   
    if (owner != null) { dialog = new ProgressDialog(owner); }
    else { dialog = new ProgressDialog(JHylaFAX.getInstance()); }

    Runnable runner = new Runnable() {
      public void run()
      {
        try {
          retSuccess[0] = job.run(new UserAbortProgressMonitor(dialog));
        }
        catch (Throwable e) {
          ret[0] = e;
        }
        SwingUtilities.invokeLater(new Runnable() {
          public void run() {
            dialog.done();
          }
        });
      }
    };

        // make sure no other jobs are started
        jobRunning = true;
       
    Thread t = new Thread(runner, "Job");
    t.start();
   
    // show blocking dialog
    if (owner != null) { dialog.setLocationRelativeTo(owner); }
    else { dialog.setLocationRelativeTo(JHylaFAX.getInstance()); }
    dialog.setTitle(i18n.tr("HylaFAX Server"));
    dialog.setModal(true);
    dialog.showDialog();
     
    // at this point t is guranteed to be finished
    jobRunning = false;
   
    // XXX what if the errordialog is displayed?
View Full Code Here

TOP

Related Classes of org.xnap.commons.gui.ProgressDialog

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.