Search in sources :

Example 1 with IProjectInfo

use of org.eclipse.xtext.ui.wizard.IProjectInfo in project xtext-eclipse by eclipse.

the class TemplateNewProjectWizard method performFinish.

@Override
public boolean performFinish() {
    final IProjectInfo projectInfo = getProjectInfo();
    IRunnableWithProgress op = new IRunnableWithProgress() {

        @Override
        public void run(IProgressMonitor monitor) throws InvocationTargetException {
            try {
                doFinish(projectInfo, monitor);
            } catch (Exception e) {
                throw new InvocationTargetException(e);
            } finally {
                monitor.done();
            }
        }
    };
    try {
        getContainer().run(true, false, op);
    } catch (InterruptedException e) {
        return false;
    } catch (InvocationTargetException e) {
        logger.error(e.getMessage(), e);
        Throwable realException = e.getTargetException();
        // $NON-NLS-1$
        MessageDialog.openError(getShell(), "Error", realException.getMessage());
        return false;
    }
    return true;
}
Also used : IProgressMonitor(org.eclipse.core.runtime.IProgressMonitor) IProjectInfo(org.eclipse.xtext.ui.wizard.IProjectInfo) InvocationTargetException(java.lang.reflect.InvocationTargetException) InvocationTargetException(java.lang.reflect.InvocationTargetException) IRunnableWithProgress(org.eclipse.jface.operation.IRunnableWithProgress)

Aggregations

InvocationTargetException (java.lang.reflect.InvocationTargetException)1 IProgressMonitor (org.eclipse.core.runtime.IProgressMonitor)1 IRunnableWithProgress (org.eclipse.jface.operation.IRunnableWithProgress)1 IProjectInfo (org.eclipse.xtext.ui.wizard.IProjectInfo)1