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

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

Introduction

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

Prototype

void createControl(Composite parent);

Source Link

Document

Creates the top level control for this dialog page under the given parent composite.

Usage

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

License:Open Source License

/**
 * Update the receiver for the new page.
 * /*  www .jav a2s.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:org.eclipse.cdt.ui.templateengine.TemplateDrivenWizard.java

License:Open Source License

@Override
public IWizardPage getNextPage(IWizardPage page) {
    if (pageIndex < pagesBeforeTemplatePages.size() - 1) {//current is a page before template pages that is not the final one
        pageIndex++;//  w  w w .  j  av a2s. com
        return pagesBeforeTemplatePages.get(pageIndex);
    } else if (pageIndex < pagesBeforeTemplatePages.size() + templatePagesOrderVector.size() - 1) {
        if (pageIndex == pagesBeforeTemplatePages.size() - 1) {//current is final page before template pages
            Template template = getTemplate();
            if (this.template != null && !this.template.equals(template)) {//template changed
                this.template = template;
                //TODO: dispose old template pages
                templatePages = template.getUIPages();
                templatePagesOrderVector = template.getPagesOrderVector();
            }
        } //else current is some template page other than the final one
        pageIndex++;
        IWizardPage nextPage = templatePages
                .get(templatePagesOrderVector.get(pageIndex - pagesBeforeTemplatePages.size()));
        nextPage.setWizard(this);
        if (nextPage.getControl() == null) {
            nextPage.createControl(pageContainer);
        }
        return nextPage;
    } else if (pageIndex < pagesBeforeTemplatePages.size() + templatePagesOrderVector.size()
            + pagesAfterTemplatePages.size() - 1) {//current is final template page or a page after the final template page
        pageIndex++;
        return pagesAfterTemplatePages
                .get(pageIndex - pagesBeforeTemplatePages.size() - templatePagesOrderVector.size());
    }
    return null;
}

From source file:org.eclipse.ecf.salvo.ui.wizards.NewNewsServerWizard.java

License:Open Source License

@Override
public void createPageControls(Composite pageContainer) {
    IWizardPage page = (IWizardPage) super.getPages()[0];
    page.createControl(pageContainer);
}

From source file:org.eclipse.ecf.salvo.ui.wizards.SubscribeGroupWizard.java

License:Open Source License

@Override
public void createPageControls(Composite pageContainer) {
    IWizardPage page = (IWizardPage) super.getPages()[0];
    page.createControl(pageContainer);
    page1.setInput(server);/*  ww w  . j  a va2s. c  o m*/
}

From source file:org.eclipse.gmt.modisco.jm2t.internal.ui.wizard.TaskWizard.java

License:Open Source License

public void createPageControls(Composite pageContainer) {
    // the default behavior is to create all the pages controls
    for (int i = 0; i < pages.size(); i++) {
        IWizardPage page = pages.get(i);
        page.createControl(pageContainer);
    }/*from  w w w. j  a v  a 2 s.  c o  m*/
}

From source file:org.eclipse.osee.framework.ui.swt.DynamicWizard.java

License:Open Source License

/**
 * The <code>Wizard</code> implementation of this <code>IWizard</code> method creates all the pages controls using
 * <code>IDialogPage.createControl</code>. Subclasses should reimplement this method if they want to delay creating
 * one or more of the pages lazily. The framework ensures that the contents of a page will be created before
 * attempting to show it./*from   w  w w  .  j  av a 2  s .c  o m*/
 */
@Override
public void createPageControls(Composite pageContainer) {
    // the default behavior is to create all the pages controls
    Set<String> keys = pages.keySet();
    for (String key : keys) {
        IWizardPage page = pages.get(key);
        page.createControl(pageContainer);
        // page is responsible for ensuring the created control is
        // accessable
        // via getControl.
        Assert.isNotNull(page.getControl());
    }
}

From source file:org.eclipse.php.internal.ui.wizards.FragmentedWizard.java

License:Open Source License

public void createPageControls(Composite pageContainer) {
    this.pageContainerHook = pageContainer;
    // the default behavior is to create all the pages controls
    for (int i = 0; i < pages.size(); i++) {
        IWizardPage page = (IWizardPage) pages.get(i);
        page.createControl(pageContainer);
    }/* w  ww.j a v a2s .  c  om*/
}

From source file:org.eclipse.ui.preferences.WizardPropertyPage.java

License:Open Source License

private void createWizardPageContent(Composite parent) {
    fWizard = createWizard();//from   w  ww.j  a  v  a  2s  . c o  m
    if (fWizard == null)
        return;

    fWizard.addPages();

    PropertyPageWizardContainer wizardContainer = new PropertyPageWizardContainer(this, fWizard);
    wizardContainer.updateButtons();
    wizardContainer.updateMessage();
    fWizard.setContainer(wizardContainer);

    Composite messageComposite = new Composite(parent, SWT.NONE);
    messageComposite.setFont(parent.getFont());
    messageComposite.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
    GridLayout layout = new GridLayout(1, false);
    layout.marginHeight = 0;
    messageComposite.setLayout(layout);

    Label messageLabel = new Label(messageComposite, SWT.WRAP);
    messageLabel.setFont(messageComposite.getFont());
    messageLabel.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));

    fWizard.createPageControls(parent);

    IWizardPage page = fWizard.getPages()[0];
    if (page.getControl() == null)
        page.createControl(parent);

    Control pageControl = page.getControl();
    pageControl.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));

    setPageName(page);
    setDescription(page, messageLabel);

    page.setVisible(true);

    setValid(fWizard.canFinish());
}

From source file:org.jboss.tools.common.model.ui.wizards.standard.DefaultStandardWizard.java

License:Open Source License

public void createPageControls(Composite pageContainer) {
    String helpContextId = (support == null) ? null : support.getHelpContextId();
    if (helpContextId != null) {
        PlatformUI.getWorkbench().getHelpSystem().setHelp(pageContainer, helpContextId);
    }//from  w ww  .  jav a2  s. c  o  m

    this.pageContainer = pageContainer;
    for (int i = 0; i < steps.length; i++) {
        IWizardPage page = steps[i];
        page.createControl(pageContainer);
    }
}

From source file:org.kalypso.afgui.wizards.NewProjectWizard.java

License:Open Source License

@Override
public void createPageControls(final Composite pageContainer) {
    // Overwritten in order to NOT create the pages during initialization, so we can set
    // the project name later before the next page is created, this works however only once :-(

    // HACK: special case: the resource page: will lead to NPE if not created
    final IWizardPage page = getPage("basicReferenceProjectPage"); //$NON-NLS-1$
    if (page != null)
        page.createControl(pageContainer);
}