Example usage for org.eclipse.jface.wizard WizardPage getErrorMessage

List of usage examples for org.eclipse.jface.wizard WizardPage getErrorMessage

Introduction

In this page you can find the example usage for org.eclipse.jface.wizard WizardPage getErrorMessage.

Prototype

@Override
    public String getErrorMessage() 

Source Link

Usage

From source file:com.android.ide.eclipse.adt.internal.wizards.exportgradle.GradleExportWizard.java

License:Open Source License

/**
 * Converts Eclipse Java projects to Gradle build files. Displays error dialogs.
 */// w  w w. j a va  2s  .co  m
public boolean generateBuildfiles(final WizardPage page) {
    IRunnableWithProgress runnable = new IRunnableWithProgress() {
        @Override
        public void run(IProgressMonitor pm) throws InterruptedException {
            Collection<GradleModule> modules = mBuilder.getModules();
            final int count = modules.size();

            SubMonitor localmonitor = SubMonitor.convert(pm, ExportMessages.StatusMessage, count);
            BuildFileCreator.createBuildFiles(mBuilder, page.getShell(), localmonitor.newChild(count));
        }
    };

    try {
        getContainer().run(false, false, runnable);
    } catch (InvocationTargetException e) {
        AdtPlugin.log(e, null);
        return false;
    } catch (InterruptedException e) {
        AdtPlugin.log(e, null);
        return false;
    }
    if (page.getErrorMessage() != null) {
        return false;
    }
    return true;
}

From source file:eu.geclipse.aws.ui.wizards.AWSAuthTokenWizard.java

License:Open Source License

@Override
public boolean performFinish() {

    WizardPage currentPage = (WizardPage) getContainer().getCurrentPage();
    if (currentPage == this.authTokenWizardPage) {
        if (!this.authTokenWizardPage.isValid()) {
            this.authTokenWizardPage.registerFormListener();
            return false;
        }/*from  www.j  ava 2  s  .  co  m*/
    }
    AWSAuthTokenDescription tokenDesc = this.authTokenWizardPage.getTokenDescription();
    AWSKeyStoreCreationOperation op = new AWSKeyStoreCreationOperation(tokenDesc);

    try {
        getContainer().run(false, false, op);
    } catch (InvocationTargetException itExc) {
        Throwable cause = itExc.getCause();
        ProblemDialog.openProblem(getShell(), Messages.getString("AWSAuthTokenWizard.problem_dialog_title"), //$NON-NLS-1$
                Messages.getString("AWSAuthTokenWizard.problem_dialog_description"), //$NON-NLS-1$
                cause);
        currentPage.setErrorMessage(cause.getLocalizedMessage());
    } catch (InterruptedException intExc) {
        currentPage.setErrorMessage(intExc.getLocalizedMessage());
    }

    String errorMessage = currentPage.getErrorMessage();

    if (errorMessage == null || errorMessage.length() == 0) {
        return true;
    }
    return false;
}

From source file:org.eclipse.andmore.internal.wizards.exportgradle.GradleExportWizard.java

License:Open Source License

/**
 * Converts Eclipse Java projects to Gradle build files. Displays error dialogs.
 *///  ww w .  j a  v a2  s.c  om
public boolean generateBuildfiles(final WizardPage page) {
    IRunnableWithProgress runnable = new IRunnableWithProgress() {
        @Override
        public void run(IProgressMonitor pm) throws InterruptedException {
            Collection<GradleModule> modules = mBuilder.getModules();
            final int count = modules.size();

            SubMonitor localmonitor = SubMonitor.convert(pm, ExportMessages.StatusMessage, count);
            BuildFileCreator.createBuildFiles(mBuilder, page.getShell(), localmonitor.newChild(count));
        }
    };

    try {
        getContainer().run(false, false, runnable);
    } catch (InvocationTargetException e) {
        AndmoreAndroidPlugin.log(e, null);
        return false;
    } catch (InterruptedException e) {
        AndmoreAndroidPlugin.log(e, null);
        return false;
    }
    if (page.getErrorMessage() != null) {
        return false;
    }
    return true;
}