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

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

Introduction

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

Prototype

public void setPreviousPage(IWizardPage page);

Source Link

Document

Sets the wizard page that would typically be shown if the user was to press the Back button.

Usage

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

License:Open Source License

public void showPage(IWizardPage page) {
    if (page == null || page == currentPage) {
        return;//  w  ww. j a va 2s  . co m
    }

    if (!isMovingToPreviousPage) {
        // remember my previous page.
        page.setPreviousPage(currentPage);
    } else {
        isMovingToPreviousPage = false;
    }

    // If page changing evaluation unsuccessful, do not change the page
    if (!doPageChanging(page))
        return;

    // Update for the new page in a busy cursor if possible
    if (getContents() == null) {
        updateForPage(page);
    } else {
        final IWizardPage finalPage = page;
        BusyIndicator.showWhile(getContents().getDisplay(), new Runnable() {
            public void run() {
                updateForPage(finalPage);
            }
        });
    }
}

From source file:ext.org.eclipse.jdt.internal.ui.refactoring.reorg.RenameTypeWizardInputPage.java

License:Open Source License

@Override
public IWizardPage getNextPage() {
    RenameTypeWizard wizard = (RenameTypeWizard) getWizard();
    IWizardPage nextPage;

    if (wizard.isRenameType()) {
        final RenameTypeProcessor renameTypeProcessor = wizard.getRenameTypeProcessor();
        try {/* w  ww.ja  v  a 2s  . co m*/
            getContainer().run(true, true, new IRunnableWithProgress() {

                public void run(IProgressMonitor pm) throws InterruptedException {
                    try {
                        renameTypeProcessor.initializeReferences(pm);
                    } catch (OperationCanceledException e) {
                        throw new InterruptedException();
                    } catch (CoreException e) {
                        ExceptionHandler.handle(e, RefactoringMessages.RenameTypeWizard_defaultPageTitle,
                                RefactoringMessages.RenameTypeWizard_unexpected_exception);
                    } finally {
                        pm.done();
                    }
                }
            });
        } catch (InvocationTargetException e) {
            ExceptionHandler.handle(e, getShell(), RefactoringMessages.RenameTypeWizard_defaultPageTitle,
                    RefactoringMessages.RenameTypeWizard_unexpected_exception);
        } catch (InterruptedException e) {
            // user canceled
            return this;
        }

        if (renameTypeProcessor.hasSimilarElementsToRename()) {
            nextPage = super.getNextPage();
        } else {
            nextPage = computeSuccessorPage();
        }

    } else
        nextPage = computeSuccessorPage();

    nextPage.setPreviousPage(this);
    return nextPage;
}

From source file:ext.org.eclipse.jdt.internal.ui.refactoring.reorg.RenameTypeWizardSimilarElementsPage.java

License:Open Source License

@Override
public IWizardPage getNextPage() {
    if (fWasInitialized)
        initializeRefFromUI();//from w  w w.  j a  va 2 s . c  o m
    // computes the input successor page
    // (=create changes)
    IWizardPage nextPage = super.getNextPage();
    if (nextPage != this) // if user pressed cancel, then the next page is the current page
        nextPage.setPreviousPage(this);
    return nextPage;
}

From source file:org.bonitasoft.studio.configuration.ui.wizard.ConfigurationWizardDialog.java

License:Open Source License

@Override
public void showPage(IWizardPage page) {
    super.showPage(page);
    page.setPreviousPage(null);
    setControlEnabled(page.getControl(), ((ConfigurationWizard) getWizard()).getProcess() != null);
    ConfigurationWizard confWizard = (ConfigurationWizard) getWizard();
    confWizard.updatePages();/*from   w  w w. ja v  a2 s .  c  o  m*/
    page.setVisible(true);
    pageChooserViewer.setSelection(new StructuredSelection(getCurrentPage()));
    group.setText(page.getTitle());
    String processName = getProcess().getName() + " (" + getProcess().getVersion() + ")";
    setTitle(Messages.bind(Messages.configurationWizardTitle, processName));
    if (((IProcessConfigurationWizardPage) page).isConfigurationPageValid(getConfiguration()) == null) {
        setMessage(Messages.bind(Messages.configurationWizardDesc, processName));
    }

}

From source file:org.bonitasoft.studio.connector.model.definition.dialog.AbstractDefinitionWizardDialog.java

License:Open Source License

protected void createToolbar(Composite parent) {
    toolbar = new ToolBar(parent, SWT.FLAT);
    toolbar.setLayoutData(//from ww  w .  j  a  va 2  s  .co m
            GridDataFactory.fillDefaults().align(SWT.BEGINNING, SWT.CENTER).grab(true, false).create());

    loadItem = new ToolItem(toolbar, SWT.NO_FOCUS | SWT.FLAT);
    loadItem.setImage(Pics.getImage("load_conf.png"));
    loadItem.setText(Messages.loadConfiguration);
    loadItem.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent e) {
            IWizardPage page = getCurrentPage();
            if (page instanceof AbstractConnectorConfigurationWizardPage) {
                AbstractConnectorConfigurationWizardPage connectorConfPage = (AbstractConnectorConfigurationWizardPage) page;
                final ConnectorConfiguration connectorConfigurationToLoad = connectorConfPage
                        .getConfiguration();
                SelectConnectorConfigurationWizard wizard = new SelectConnectorConfigurationWizard(
                        connectorConfigurationToLoad, configurationStore);
                WizardDialog dialog = new WizardDialog(Display.getDefault().getActiveShell(), wizard);
                if (dialog.open() == Dialog.OK) {
                    IConnectorDefinitionContainer connectorWizard = (IConnectorDefinitionContainer) getWizard();
                    ConnectorDefinition def = connectorWizard.getDefinition();
                    IWizardPage namePage = getWizard().getPage(SelectNameAndDescWizardPage.class.getName());
                    if (namePage != null) {
                        IWizardPage previousNamePage = namePage.getPreviousPage();
                        showPage(namePage);
                        namePage.setPreviousPage(previousNamePage);
                        connectorWizard.recreateConnectorConfigurationPages(def, false);
                    } else {
                        IWizardPage[] wizardPages = getWizard().getPages();
                        if (wizardPages.length > 1) {
                            IWizardPage firstPage = wizardPages[0];
                            showPage(firstPage.getNextPage());
                        }
                    }

                    updateButtons();
                }
            }
        }
    });

    saveItem = new ToolItem(toolbar, SWT.NO_FOCUS | SWT.FLAT);
    saveItem.setImage(Pics.getImage("save_conf.png"));
    saveItem.setText(Messages.saveConfiguration);
    ITestConfigurationListener listener = getTestListener(null, (IWizard) null);
    if (implStore != null && listener != null) {
        testItem = new ToolItem(toolbar, SWT.NO_FOCUS | SWT.FLAT);
        testItem.setImage(Pics.getImage("test.png"));
        testItem.setText(Messages.testConfiguration);
        testItem.setEnabled(false);
    }
}

From source file:org.ebayopensource.vjet.eclipse.internal.ui.refactoring.rename.RenameTypeWizardInputPage.java

License:Open Source License

public IWizardPage getNextPage() {
    RenameTypeWizard wizard = (RenameTypeWizard) getWizard();
    IWizardPage nextPage;

    if (wizard.isRenameType()) {
        final RenameVjoTypeProcessor renameTypeProcessor = wizard.getRenameTypeProcessor();
        try {// ww  w  . ja va 2s .co m
            getContainer().run(true, true, new IRunnableWithProgress() {

                public void run(IProgressMonitor pm) throws InterruptedException {
                    try {
                        renameTypeProcessor.initializeReferences(pm);
                    } catch (OperationCanceledException e) {
                        throw new InterruptedException();
                    } catch (CoreException e) {
                        ExceptionHandler.handle(e, RefactoringMessages.RenameTypeWizard_defaultPageTitle,
                                RefactoringMessages.RenameTypeWizard_unexpected_exception);
                    } finally {
                        pm.done();
                    }
                }
            });
        } catch (InvocationTargetException e) {
            ExceptionHandler.handle(e, getShell(), RefactoringMessages.RenameTypeWizard_defaultPageTitle,
                    RefactoringMessages.RenameTypeWizard_unexpected_exception);
        } catch (InterruptedException e) {
            // user canceled
            return this;
        }

        if (renameTypeProcessor.hasSimilarElementsToRename()) {
            nextPage = super.getNextPage();
        } else {
            nextPage = computeSuccessorPage();
        }

    } else
        nextPage = computeSuccessorPage();

    nextPage.setPreviousPage(this);
    return nextPage;
}

From source file:org.eclipse.bpel.ui.wizards.NewBpelFileFirstPage.java

License:Open Source License

@Override
public IWizardPage getNextPage() {

    IWizardPage nextPage;
    if (this.creationMode == BpelCreationMode.CREATE_NEW_BPEL)
        nextPage = getWizard().getPage(NewBpelFileTemplatePage.PAGE_NAME);
    else// w  w  w  .  j a  v a2 s  .  co m
        nextPage = getWizard().getPage(NewBpelFilePortTypePage.PAGE_NAME);

    nextPage.setPreviousPage(this);
    return nextPage;
}

From source file:org.eclipse.bpel.ui.wizards.NewBpelFilePortTypePage.java

License:Open Source License

@Override
public IWizardPage getNextPage() {

    // We need to do that since the page order depends on user choices
    IWizardPage nextPage = getWizard().getPage(NewBpelFileLocationPage.PAGE_NAME);
    nextPage.setPreviousPage(this);
    return nextPage;
}

From source file:org.eclipse.buckminster.jnlp.p2.wizard.install.InstallWizard.java

License:Open Source License

private void showOriginalPage(IWizardPage originalPage) {
    WizardPage originalPreviousPage = (WizardPage) originalPage.getPreviousPage();
    getContainer().showPage(originalPage);
    originalPage.setPreviousPage(originalPreviousPage);
}

From source file:org.eclipse.cdt.ui.templateengine.Template.java

License:Open Source License

public IWizardPage[] getTemplateWizardPages(IWizardPage predatingPage, IWizardPage followingPage,
        IWizard wizard) {/* w  ww.  j  a va 2  s  . c o  m*/
    List<IWizardDataPage> pages = new ArrayList<IWizardDataPage>();
    //      if (predatingPage != null) { 
    //         pages.add(predatingPage);
    //      }

    Map<String, UIWizardPage> templatePages = getUIPages();
    List<String> templatePagesOrderVector = getPagesOrderVector();
    if (templatePagesOrderVector.size() != 0) {
        IWizardPage prevPage = predatingPage;

        for (int i = 0; i < templatePagesOrderVector.size(); i++) {
            UIWizardPage page = templatePages.get(templatePagesOrderVector.get(i));
            pages.add(page);
            page.setPreviousPage(prevPage);
            if (i + 1 < templatePagesOrderVector.size()) {
                page.setNextPage(templatePages.get(templatePagesOrderVector.get(i + 1)));
            } else {
                page.setNextPage(followingPage);
            }
            page.setWizard(wizard);
            prevPage = page;
        }

        predatingPage = prevPage;
    }

    try {
        IWizardPage prevPage = predatingPage;
        IWizardDataPage[] extraPages = getExtraCreatedPages((IWorkbenchWizard) wizard,
                PlatformUI.getWorkbench(), null);
        for (IWizardDataPage page : extraPages) {
            pages.add(page);
            page.setPreviousPage(prevPage);

            if (prevPage instanceof IWizardDataPage) {
                ((IWizardDataPage) prevPage).setNextPage(page);
            }

            page.setWizard(wizard);
            prevPage = page;
        }

        if (prevPage instanceof IWizardDataPage) {
            ((IWizardDataPage) prevPage).setNextPage(followingPage);
        }
    } catch (Exception e) {
        e.printStackTrace();
    }

    if (followingPage != null)
        followingPage.setPreviousPage(predatingPage);

    return pages.toArray(new IWizardPage[pages.size()]);
}