Search in sources :

Example 11 with WizardPage

use of org.eclipse.jface.wizard.WizardPage in project translationstudio8 by heartsome.

the class NewTermDbBaseInfoPage method getNextPage.

public IWizardPage getNextPage() {
    WizardPage nextPage = (WizardPage) super.getNextPage();
    IRunnableWithProgress runnable = new IRunnableWithProgress() {

        public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
            if (canCreateDb(monitor) != null) {
                throw new InterruptedException();
            }
        }
    };
    try {
        getContainer().run(true, true, runnable);
    } catch (InvocationTargetException e) {
        logger.error("", e);
        e.printStackTrace();
        return null;
    } catch (InterruptedException e) {
        e.printStackTrace();
        return null;
    }
    nextPage.setErrorMessage(null);
    return nextPage;
}
Also used : IProgressMonitor(org.eclipse.core.runtime.IProgressMonitor) IWizardPage(org.eclipse.jface.wizard.IWizardPage) WizardPage(org.eclipse.jface.wizard.WizardPage) InvocationTargetException(java.lang.reflect.InvocationTargetException) IRunnableWithProgress(org.eclipse.jface.operation.IRunnableWithProgress)

Example 12 with WizardPage

use of org.eclipse.jface.wizard.WizardPage in project translationstudio8 by heartsome.

the class NewTmDbBaseInfoPage method getNextPage.

public IWizardPage getNextPage() {
    WizardPage nextPage = (WizardPage) super.getNextPage();
    IRunnableWithProgress runnable = new IRunnableWithProgress() {

        public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
            if (canCreateDb(monitor) != null) {
                throw new InterruptedException();
            }
        }
    };
    try {
        getContainer().run(true, true, runnable);
    } catch (InvocationTargetException e) {
        e.printStackTrace();
        return null;
    } catch (InterruptedException e) {
        e.printStackTrace();
        return null;
    }
    nextPage.setErrorMessage(null);
    return nextPage;
}
Also used : IProgressMonitor(org.eclipse.core.runtime.IProgressMonitor) IWizardPage(org.eclipse.jface.wizard.IWizardPage) WizardPage(org.eclipse.jface.wizard.WizardPage) InvocationTargetException(java.lang.reflect.InvocationTargetException) IRunnableWithProgress(org.eclipse.jface.operation.IRunnableWithProgress)

Example 13 with WizardPage

use of org.eclipse.jface.wizard.WizardPage in project sling by apache.

the class AbstractNewSlingApplicationWizard method reportError.

public void reportError(CoreException e) {
    WizardPage currentPage = getCurrentWizardPage();
    if (currentPage != null) {
        currentPage.setMessage(e.getMessage(), IMessageProvider.ERROR);
    } else {
        MessageDialog.openError(getShell(), "Unexpected error", e.getMessage());
    }
    Activator.getDefault().getLog().log(e.getStatus());
}
Also used : IWizardPage(org.eclipse.jface.wizard.IWizardPage) WizardPage(org.eclipse.jface.wizard.WizardPage)

Example 14 with WizardPage

use of org.eclipse.jface.wizard.WizardPage in project yamcs-studio by yamcs.

the class NewOPIImageLibExampleWizard method addPages.

@Override
public void addPages() {
    super.addPages();
    setWindowTitle(WINDOW_TITLE);
    addPage(new WizardPage(WIZARD_PAGE) {

        @Override
        public void createControl(Composite parent) {
            setTitle(WIZARD_PAGE_TITLE);
            setDescription(WIZARD_PAGE_DESCRIPTION);
            Composite container = new Composite(parent, SWT.None);
            container.setLayout(new GridLayout());
            setControl(container);
            Label label = new Label(container, SWT.WRAP);
            GridData gd = new GridData();
            gd.widthHint = 500;
            label.setLayoutData(gd);
            label.setText("OPI Image Library will be imported to your workspace. " + NLS.bind("If there is already a project named \"{0}\" in your workspace," + "the import will fail. ", InstallOPIImageLibraryAction.PROJECT_NAME) + "Please rename or delete it and import again.");
        }
    });
}
Also used : GridLayout(org.eclipse.swt.layout.GridLayout) Composite(org.eclipse.swt.widgets.Composite) WizardPage(org.eclipse.jface.wizard.WizardPage) Label(org.eclipse.swt.widgets.Label) GridData(org.eclipse.swt.layout.GridData)

Example 15 with WizardPage

use of org.eclipse.jface.wizard.WizardPage in project epp.mpc by eclipse.

the class MarketplacePage method showNextPage.

protected void showNextPage() {
    IWizardContainer container = getContainer();
    if (container == null) {
        return;
    }
    IWizardPage currentPage = container.getCurrentPage();
    if (currentPage == MarketplacePage.this && currentPage.isPageComplete()) {
        IWizardPage nextPage = getNextPage();
        if (nextPage != null && nextPage instanceof WizardPage) {
            ((WizardPage) nextPage).setPageComplete(true);
            container.showPage(nextPage);
        }
    }
}
Also used : IWizardContainer(org.eclipse.jface.wizard.IWizardContainer) IWizardPage(org.eclipse.jface.wizard.IWizardPage) WizardPage(org.eclipse.jface.wizard.WizardPage) IWizardPage(org.eclipse.jface.wizard.IWizardPage)

Aggregations

WizardPage (org.eclipse.jface.wizard.WizardPage)25 IWizardPage (org.eclipse.jface.wizard.IWizardPage)6 Composite (org.eclipse.swt.widgets.Composite)6 Label (org.eclipse.swt.widgets.Label)6 GridData (org.eclipse.swt.layout.GridData)5 GridLayout (org.eclipse.swt.layout.GridLayout)5 OptionTemplateWizardPage (org.eclipse.gemoc.commons.eclipse.pde.wizards.pages.pde.ui.templates.OptionTemplateWizardPage)3 InvocationTargetException (java.lang.reflect.InvocationTargetException)2 IProgressMonitor (org.eclipse.core.runtime.IProgressMonitor)2 TemplateOption (org.eclipse.gemoc.commons.eclipse.pde.wizards.pages.pde.ui.templates.TemplateOption)2 IRunnableWithProgress (org.eclipse.jface.operation.IRunnableWithProgress)2 IWizardContainer (org.eclipse.jface.wizard.IWizardContainer)2 Optional (com.google.common.base.Optional)1 FluentIterable.from (com.google.common.collect.FluentIterable.from)1 Sets.newTreeSet (com.google.common.collect.Sets.newTreeSet)1 Ints (com.google.common.primitives.Ints)1 Inject (com.google.inject.Inject)1 Arrays (java.util.Arrays)1 Collection (java.util.Collection)1 Collections.singletonList (java.util.Collections.singletonList)1