Example usage for org.eclipse.jface.wizard IWizard getPageCount

List of usage examples for org.eclipse.jface.wizard IWizard getPageCount

Introduction

In this page you can find the example usage for org.eclipse.jface.wizard IWizard getPageCount.

Prototype

int getPageCount();

Source Link

Document

Returns the number of pages in this wizard.

Usage

From source file:org.eclipse.team.internal.ui.wizards.ConfigurationWizardElement.java

License:Open Source License

/**
 * Return whether the wizard created for this element has pages.
 * Unfortunately, the only way to find this out is to create the wizard.
 * @param projects the projects being shared
 * @return whether the resulting wizard has pages
 *///from   ww  w  . j  av a2  s. c  om
public boolean wizardHasPages(IProject[] projects) {
    try {
        IWizard wizard = (IWizard) createExecutableExtension(projects);
        try {
            wizard.addPages();
            return (wizard.getPageCount() > 0);
        } finally {
            wizard.dispose();
        }
    } catch (CoreException e) {
        TeamUIPlugin.log(e);
    } catch (RuntimeException e) {
        // If a general exception occurred here, log it and continue
        TeamUIPlugin.log(IStatus.ERROR, "An internal error occurred", e); //$NON-NLS-1$
    }
    return false;
}