Example usage for org.eclipse.jface.dialogs ProgressMonitorDialog ProgressMonitorDialog

List of usage examples for org.eclipse.jface.dialogs ProgressMonitorDialog ProgressMonitorDialog

Introduction

In this page you can find the example usage for org.eclipse.jface.dialogs ProgressMonitorDialog ProgressMonitorDialog.

Prototype

public ProgressMonitorDialog(Shell parent) 

Source Link

Document

Creates a progress monitor dialog under the given shell.

Usage

From source file:com.aspose.email.maven.examples.AsposeExampleWizardPage.java

License:Open Source License

private void downloadExamplesRepo() {
    // download code examples with status progress
    try {//  w w w.  ja  v  a2s.  c o m
        new ProgressMonitorDialog(this.getShell()).run(true, false, new IRunnableWithProgress() {
            public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
                monitor.beginTask("Downloading latest example categories...", IProgressMonitor.UNKNOWN);

                AsposeMavenProjectManager.initialize(null);
                AsposeJavaAPI component = AsposeEmailJavaAPI
                        .initialize(AsposeMavenProjectManager.getInstance());
                component.checkAndUpdateRepo();

                monitor.done();
            }
        });
    } catch (InvocationTargetException | InterruptedException e) {
        e.printStackTrace();
    }
}

From source file:com.aspose.pdf.maven.examples.AsposeExampleWizardPage.java

License:Open Source License

private void downloadExamplesRepo() {
    // download code examples with status progress
    try {// w  w w  .  jav a 2  s.  c  om
        new ProgressMonitorDialog(this.getShell()).run(true, false, new IRunnableWithProgress() {
            public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
                monitor.beginTask("Downloading latest example categories...", IProgressMonitor.UNKNOWN);

                AsposeMavenProjectManager.initialize(null);
                AsposeJavaAPI component = AsposePdfJavaAPI.initialize(AsposeMavenProjectManager.getInstance());
                component.checkAndUpdateRepo();

                monitor.done();
            }
        });
    } catch (InvocationTargetException | InterruptedException e) {
        e.printStackTrace();
    }
}

From source file:com.aspose.slides.maven.examples.AsposeExampleWizardPage.java

License:Open Source License

private void downloadExamplesRepo() {
    // download code examples with status progress
    try {//www.j av  a2  s.c o m
        new ProgressMonitorDialog(this.getShell()).run(true, false, new IRunnableWithProgress() {
            public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
                monitor.beginTask("Downloading latest example categories...", IProgressMonitor.UNKNOWN);

                AsposeMavenProjectManager.initialize(null);
                AsposeJavaAPI component = AsposeSlidesJavaAPI
                        .initialize(AsposeMavenProjectManager.getInstance());
                component.checkAndUpdateRepo();

                monitor.done();
            }
        });
    } catch (InvocationTargetException | InterruptedException e) {
        e.printStackTrace();
    }
}

From source file:com.aspose.tasks.maven.examples.AsposeExampleWizardPage.java

License:Open Source License

private void downloadExamplesRepo() {
    // download code examples with status progress
    try {//from   w ww.j  ava 2  s .com
        new ProgressMonitorDialog(this.getShell()).run(true, false, new IRunnableWithProgress() {
            public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
                monitor.beginTask("Downloading latest example categories...", IProgressMonitor.UNKNOWN);

                AsposeMavenProjectManager.initialize(null);
                AsposeJavaAPI component = AsposeTasksJavaAPI
                        .initialize(AsposeMavenProjectManager.getInstance());
                component.checkAndUpdateRepo();

                monitor.done();
            }
        });
    } catch (InvocationTargetException | InterruptedException e) {
        e.printStackTrace();
    }
}

From source file:com.aspose.words.maven.examples.AsposeExampleWizardPage.java

License:Open Source License

private void downloadExamplesRepo() {
    // download code examples with status progress
    try {/*from w  w  w. j a v a  2  s. c o m*/
        new ProgressMonitorDialog(this.getShell()).run(true, false, new IRunnableWithProgress() {
            public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
                monitor.beginTask("Downloading latest example categories...", IProgressMonitor.UNKNOWN);

                AsposeMavenProjectManager.initialize(null);
                AsposeJavaAPI component = AsposeWordsJavaAPI
                        .initialize(AsposeMavenProjectManager.getInstance());
                component.checkAndUpdateRepo();

                monitor.done();
            }
        });
    } catch (InvocationTargetException | InterruptedException e) {
        e.printStackTrace();
    }
}

From source file:com.astra.ses.spell.dev.database.DatabaseManager.java

License:Open Source License

/***************************************************************************
 * Load the database for the given project
 * /*from www.  j a  v  a 2 s.  c o m*/
 * @param project
 * @throws DatabaseLoadException
 **************************************************************************/
private void loadProjectdatabase(IProject project, IProgressMonitor monitor) throws DatabaseLoadException {
    DatabasePropertiesManager manager = new DatabasePropertiesManager(project);
    String driver = manager.getDatabaseDriverName();
    String path = manager.getDatabasePath();

    DatabaseLoadJob dbLoad = new DatabaseLoadJob(project, driver, path);
    IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
    if (window != null) {
        ProgressMonitorDialog dialog = new ProgressMonitorDialog(window.getShell());
        try {
            dialog.setCancelable(false);
            dialog.run(true, false, dbLoad);
            if (dbLoad.result.getSeverity() == IStatus.ERROR) {
                throw new DatabaseLoadException(dbLoad.result.getMessage());
            }
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    } else {
        dbLoad.run(monitor);
        if (dbLoad.result.getSeverity() == IStatus.ERROR) {
            throw new DatabaseLoadException(dbLoad.result.getMessage());
        }
    }
}

From source file:com.astra.ses.spell.dev.scheck.ui.handlers.JobHelper.java

License:Open Source License

public static void executeJob(IRunnableWithProgress job, boolean fork, boolean cancelable) {
    IWorkbenchWindow window = Activator.getDefault().getWorkbench().getActiveWorkbenchWindow();
    ProgressMonitorDialog dialog = new ProgressMonitorDialog(window.getShell());
    try {/*from  ww  w. java 2  s.c  o  m*/
        dialog.run(true, true, job);
    } catch (InvocationTargetException e) {
        e.printStackTrace();
    } catch (InterruptedException e) {
        e.printStackTrace();
    }
}

From source file:com.astra.ses.spell.dev.wizards.ProcedureWizard.java

License:Open Source License

@Override
public boolean performFinish() {
    Path path = m_infoPage.getAbsoluteFilePath();
    IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
    boolean result = false;
    try {//from  w w  w .  java2 s .c  o  m
        final IFile file = root.getFile(path);
        InputStream header = getSourceCodeHeader();
        file.create(header, true, null);

        /*
         * Perform extended actions
         */
        final ArrayList<IRunnableWithProgress> runnables = new ArrayList<IRunnableWithProgress>();
        for (IProcedureCreationExtension extension : m_procedureExtensions) {
            IRunnableWithProgress job = extension.prepareJob(file);
            if (job != null) {
                runnables.add(job);
            }
        }
        Display.getDefault().asyncExec(new Runnable() {
            @Override
            public void run() {
                ProgressMonitorDialog dialog = new ProgressMonitorDialog(new Shell());
                try {
                    dialog.setCancelable(true);
                    for (IRunnableWithProgress job : runnables) {
                        dialog.run(false, true, job);
                    }
                } catch (InvocationTargetException e) {
                    e.printStackTrace();
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        });

        /*
         * Open the editor if possible
         */
        IWorkbenchWindow dw = m_workbench.getActiveWorkbenchWindow();
        if (dw != null) {
            IWorkbenchPage page = dw.getActivePage();
            if (page != null) {
                IDE.openEditor(page, file, true);
            }
        }

        result = true;
    } catch (CoreException e) {
        e.printStackTrace();
    }
    return result;
}

From source file:com.astra.ses.spell.dev.wizards.procs.pages.ProcedureControlVersionWizardPage.java

License:Open Source License

@Override
public void performActions() {
    if (m_controlVersionJob == null)
        return;//from   w  w  w .j ava 2s .c  om

    ProgressMonitorDialog dialog = new ProgressMonitorDialog(new Shell());
    try {
        dialog.setCancelable(true);
        dialog.run(false, true, m_controlVersionJob);
    } catch (InvocationTargetException e) {
        e.printStackTrace();
    } catch (InterruptedException e) {
        e.printStackTrace();
    }
}

From source file:com.astra.ses.spell.gui.model.commands.helpers.CommandHelper.java

License:Open Source License

public static void executeInProgress(IRunnableWithProgress job, boolean cancellable, boolean fork) {
    IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
    ProgressMonitorDialog dialog = new ProgressMonitorDialog(window.getShell());
    try {/*from   ww w.  j  a va  2s.  c o m*/
        dialog.setCancelable(cancellable);
        dialog.run(fork, cancellable, job);
    } catch (InvocationTargetException e) {
        e.printStackTrace();
    } catch (InterruptedException e) {
        e.printStackTrace();
    }
}