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

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

Introduction

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

Prototype

void dispose();

Source Link

Document

Disposes of this wizard and frees all SWT resources.

Usage

From source file:com.codesourcery.internal.installer.ui.WizardDialog.java

License:Open Source License

/**
 * Closes this window.//from   w  w  w.j a  va 2  s.c  om
 * 
 * @return <code>true</code> if the window is (or was already) closed, and
 *         <code>false</code> if it is still open
 */
private boolean hardClose() {
    // inform wizards
    for (int i = 0; i < createdWizards.size(); i++) {
        IWizard createdWizard = (IWizard) createdWizards.get(i);
        try {
            createdWizard.dispose();
        } catch (Exception e) {
            Status status = new Status(IStatus.ERROR, Policy.JFACE, IStatus.ERROR, e.getMessage(), e);
            Policy.getLog().log(status);
        }
        // Remove this dialog as a parent from the managed wizard.
        // Note that we do this after calling dispose as the wizard or
        // its pages may need access to the container during
        // dispose code
        createdWizard.setContainer(null);
    }
    // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=202534
    // disposing the wizards could cause the image currently set in
    // this dialog to be disposed.  A subsequent repaint event during
    // close would then fail.  To prevent this case, we null out the image.
    setTitleImage(null);
    return super.close();
}

From source file:net.geoprism.shapefile.LocalizedWizardDialog.java

License:Open Source License

/**
 * Closes this window.//from w  w  w  .ja v  a2 s  .  co  m
 * 
 * @return <code>true</code> if the window is (or was already) closed, and
 *         <code>false</code> if it is still open
 */
private boolean hardClose() {
    // inform wizards
    for (int i = 0; i < createdWizards.size(); i++) {
        IWizard createdWizard = (IWizard) createdWizards.get(i);
        createdWizard.dispose();
        // Remove this dialog as a parent from the managed wizard.
        // Note that we do this after calling dispose as the wizard or
        // its pages may need access to the container during
        // dispose code
        createdWizard.setContainer(null);
    }
    // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=202534
    // disposing the wizards could cause the image currently set in
    // this dialog to be disposed. A subsequent repaint event during
    // close would then fail. To prevent this case, we null out the image.
    setTitleImage(null);
    return super.close();
}

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
 *///  w w w .j  a  va2s .  co m
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;
}

From source file:org.modelio.api.ui.ModelioWizardDialog.java

License:Apache License

/**
 * Closes this window.//from   w ww  .j av a 2 s .co  m
 * @return <code>true</code> if the window is (or was already) closed, and
 * <code>false</code> if it is still open
 */
@objid("d65afcd5-910f-11e0-9de7-002564c97630")
private boolean hardClose() {
    // inform wizards
    for (int i = 0; i < this.createdWizards.size(); i++) {
        IWizard createdWizard = this.createdWizards.get(i);
        createdWizard.dispose();
        // Remove this dialog as a parent from the managed wizard.
        // Note that we do this after calling dispose as the wizard or
        // its pages may need access to the container during
        // dispose code
        createdWizard.setContainer(null);
    }
    // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=202534
    // disposing the wizards could cause the image currently set in
    // this dialog to be disposed.  A subsequent repaint event during
    // close would then fail.  To prevent this case, we null out the image.
    setTitleLeftImage(null);
    return super.close();
}