Example usage for org.eclipse.jface.wizard IWizardPage getWizard

List of usage examples for org.eclipse.jface.wizard IWizardPage getWizard

Introduction

In this page you can find the example usage for org.eclipse.jface.wizard IWizardPage getWizard.

Prototype

public IWizard getWizard();

Source Link

Document

Returns the wizard that hosts this wizard page.

Usage

From source file:cn.dockerfoundry.ide.eclipse.server.ui.internal.wizards.WizardFragmentStatusHandler.java

License:Open Source License

/**
 * Determines if the message can be set. This is to guard against possible
 * NPE if attempting to set a message when the handle is a wizard page and
 * the wizard container is not yet available.
 * @return true if it can be set. False if it is not possible (e.g, wizard
 * container is not available yet)/*from w w w  .  jav  a 2  s . c o m*/
 */
protected boolean canUpdate() {
    if (!(wizardHandle instanceof IWizardPage)) {
        return true;
    }
    IWizardPage page = (IWizardPage) wizardHandle;
    return page.getWizard() != null && page.getWizard().getContainer() != null;
}

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

License:Open Source License

/**
 * Update the receiver for the new page.
 * //from w w w  .j  a  va2 s .  c  o  m
 * @param page
 */
private void updateForPage(IWizardPage page) {
    // ensure this page belongs to the current wizard
    if (wizard != page.getWizard()) {
        setWizard(page.getWizard());
    }
    // ensure that page control has been created
    // (this allows lazy page control creation)
    if (page.getControl() == null) {
        page.createControl(pageContainer);
        // the page is responsible for ensuring the created control is
        // accessible via getControl.
        Assert.isNotNull(page.getControl(),
                JFaceResources.format(JFaceResources.getString("WizardDialog.missingSetControl"), //$NON-NLS-1$
                        new Object[] { page.getName() }));
        // ensure the dialog is large enough for this page
        updateSize(page);
    }
    // make the new page visible
    IWizardPage oldPage = currentPage;
    currentPage = page;

    currentPage.setVisible(true);
    if (oldPage != null) {
        oldPage.setVisible(false);
    }
    // update the dialog controls
    update();
}

From source file:com.nokia.carbide.cpp.uiq.ui.viewwizard.ViewWizardManager.java

License:Open Source License

public IWizardPage getNextPage(IWizardPage page) {
    if (page.equals(appDefinitionPage))
        return initialContentPage;

    if (page.equals(initialContentPage)) {
        if (customizerUI != null)
            return customizerPage;
        else/* w w w .  j a v a2s  . co m*/
            return containerSelectionPage;
    }

    if (page.equals(customizerPage))
        return containerSelectionPage;

    return page.getWizard().getNextPage(page);
}

From source file:com.nokia.carbide.cpp.uiq.ui.viewwizard.ViewWizardManager.java

License:Open Source License

public IWizardPage getPreviousPage(IWizardPage page) {
    if (page.equals(appDefinitionPage))
        return page.getPreviousPage();

    if (page.equals(containerSelectionPage)) {
        if (customizerUI != null)
            return customizerPage;
        else//w  w  w.ja v  a  2  s.c o  m
            return initialContentPage;
    }

    if (page.equals(customizerPage))
        return initialContentPage;

    if (page.equals(initialContentPage))
        return appDefinitionPage;

    return page.getWizard().getPreviousPage(page);
}

From source file:com.siteview.mde.internal.runtime.spy.sections.ActiveWizardSection.java

License:Open Source License

public void build(ScrolledForm form, SpyFormToolkit toolkit, ExecutionEvent event) {
    final Shell shell = HandlerUtil.getActiveShell(event);
    Object object = shell.getData();
    if (object == null)
        return;//from   w  ww  . j a  v  a 2  s. com
    Class clazz = object.getClass();

    if (object instanceof WizardDialog) {
        WizardDialog dialog = (WizardDialog) object;
        IWizardPage page = dialog.getCurrentPage();
        IWizard wizard = page.getWizard();
        clazz = wizard.getClass();

        Section section = toolkit.createSection(form.getBody(), ExpandableComposite.TITLE_BAR);
        section.clientVerticalSpacing = 9;

        // the active wizard
        FormText text = toolkit.createFormText(section, true);
        section.setClient(text);
        TableWrapData td = new TableWrapData();
        td.align = TableWrapData.FILL;
        td.grabHorizontal = true;
        section.setLayoutData(td);

        StringBuffer buffer = new StringBuffer();
        buffer.append("<form>"); //$NON-NLS-1$
        section.setText(NLS.bind(MDERuntimeMessages.SpyDialog_activeWizard_title, wizard.getWindowTitle()));

        buffer.append(toolkit.createClassSection(text, MDERuntimeMessages.SpyDialog_activeWizard_desc,
                new Class[] { clazz }));

        PackageAdmin admin = PDERuntimePlugin.getDefault().getPackageAdmin();
        Bundle bundle = admin.getBundle(clazz);
        toolkit.generatePluginDetailsText(bundle, null, "wizard", buffer, text); //$NON-NLS-1$
        buffer.append("</form>"); //$NON-NLS-1$

        text.setText(buffer.toString(), true, false);
    }
}

From source file:gov.redhawk.ide.spd.ui.wizard.NewScaResourceWizard.java

License:Open Source License

/**
 * Provides the index of the given wizard page.
 * @param page The page who's index you are looking for
 * @return//from  ww w.  ja  v  a 2s. co m
 */
private int getWizardPageIndex(IWizardPage page) {
    IWizard pageWizard = page.getWizard();

    IWizardPage[] allPages = pageWizard.getPages();
    List<IWizardPage> arrayOfPages = Arrays.asList(allPages);

    return arrayOfPages.indexOf(page);
}

From source file:org.eclipse.birt.report.designer.internal.ui.editors.wizards.SaveReportAsWizardDialog.java

License:Open Source License

protected void finishPressed() {
    super.finishPressed();
    IWizardPage page = getCurrentPage();
    IWizard wizard = page.getWizard();
    this.saveAsPath = ((SaveReportAsWizard) wizard).getSaveAsPath();
}

From source file:org.eclipse.pde.internal.runtime.spy.sections.ActiveWizardSection.java

License:Open Source License

public void build(ScrolledForm form, SpyFormToolkit toolkit, ExecutionEvent event) {
    final Shell shell = HandlerUtil.getActiveShell(event);
    Object object = shell.getData();
    if (object == null)
        return;/*from  ww  w  .  ja  v  a  2s.  c  o  m*/
    Class clazz = object.getClass();

    if (object instanceof WizardDialog) {
        WizardDialog dialog = (WizardDialog) object;
        IWizardPage page = dialog.getCurrentPage();
        IWizard wizard = page.getWizard();
        clazz = wizard.getClass();

        Section section = toolkit.createSection(form.getBody(), ExpandableComposite.TITLE_BAR);
        section.clientVerticalSpacing = 9;

        // the active wizard
        FormText text = toolkit.createFormText(section, true);
        section.setClient(text);
        TableWrapData td = new TableWrapData();
        td.align = TableWrapData.FILL;
        td.grabHorizontal = true;
        section.setLayoutData(td);

        StringBuffer buffer = new StringBuffer();
        buffer.append("<form>"); //$NON-NLS-1$
        section.setText(NLS.bind(PDERuntimeMessages.SpyDialog_activeWizard_title, wizard.getWindowTitle()));

        buffer.append(toolkit.createClassSection(text, PDERuntimeMessages.SpyDialog_activeWizard_desc,
                new Class[] { clazz }));

        Bundle bundle = FrameworkUtil.getBundle(clazz);
        toolkit.generatePluginDetailsText(bundle, null, "wizard", buffer, text); //$NON-NLS-1$
        buffer.append("</form>"); //$NON-NLS-1$

        text.setText(buffer.toString(), true, false);
    }
}

From source file:org.jboss.tools.common.ui.WizardUtils.java

License:Open Source License

/**
 * Flips to the next wizard page or finishes the current wizard.
 * // w ww .j  a  v  a  2 s .c o m
 * @param wizardPage
 *            the wizard page this call is executed in
 */
public static void nextPageOrFinish(IWizardPage wizardPage) {
    IWizard wizard = wizardPage.getWizard();
    if (wizardPage.canFlipToNextPage()) {
        IWizardPage nextPage = wizard.getNextPage(wizardPage);
        wizard.getContainer().showPage(nextPage);
    } else if (wizard.canFinish()) {
        if (wizard.performFinish()) {
            wizard.getContainer().getShell().close();
        }
    }
}

From source file:org.jboss.tools.jst.angularjs.test.InsertJSCSSPaletteEntryTest.java

License:Open Source License

void runJSCSS() {
    IWizardPage currentPage = runToolEntry(IonicConstants.IONIC_CATEGORY, "JS/CSS", true);
    if (currentPage instanceof IonicVersionPage) {
        IWizard wizard = currentPage.getWizard();
        wizard.performFinish();//  www  .  j  a va 2s. c o m
        WizardDialog dialog = (WizardDialog) wizard.getContainer();
        dialog.close();
    }
}