Search in sources :

Example 1 with IWizardPage

use of org.eclipse.jface.wizard.IWizardPage in project dbeaver by serge-rider.

the class MultiPageWizardDialog method updateButtons.

@Override
public void updateButtons() {
    boolean complete = true;
    for (TreeItem item : pagesTree.getItems()) {
        if (item.getData() instanceof IWizardPage) {
            IWizardPage page = (IWizardPage) item.getData();
            if (page.getControl() != null && !page.isPageComplete()) {
                complete = false;
                break;
            }
        }
    }
    Button button = getButton(IDialogConstants.OK_ID);
    if (button != null && !button.isDisposed()) {
        button.setEnabled(complete);
    }
}
Also used : IWizardPage(org.eclipse.jface.wizard.IWizardPage)

Example 2 with IWizardPage

use of org.eclipse.jface.wizard.IWizardPage in project translationstudio8 by heartsome.

the class TSWizardDialog method updateSizeForWizard.

/**
	 * Computes the correct dialog size for the given wizard and resizes its shell if necessary.
	 * 
	 * @param sizingWizard the wizard
	 */
private void updateSizeForWizard(IWizard sizingWizard) {
    Point delta = new Point(0, 0);
    IWizardPage[] pages = sizingWizard.getPages();
    for (int i = 0; i < pages.length; i++) {
        // ensure the page container is large enough
        Point pageDelta = calculatePageSizeDelta(pages[i]);
        delta.x = Math.max(delta.x, pageDelta.x);
        delta.y = Math.max(delta.y, pageDelta.y);
    }
    if (delta.x > 0 || delta.y > 0) {
        // increase the size of the shell
        Shell shell = getShell();
        Point shellSize = shell.getSize();
        setShellSize(shellSize.x + delta.x, shellSize.y + delta.y);
    }
}
Also used : Shell(org.eclipse.swt.widgets.Shell) IWizardPage(org.eclipse.jface.wizard.IWizardPage) Point(org.eclipse.swt.graphics.Point) Point(org.eclipse.swt.graphics.Point)

Example 3 with IWizardPage

use of org.eclipse.jface.wizard.IWizardPage in project translationstudio8 by heartsome.

the class TSWizardDialog method updateForPage.

/**
	 * Update the receiver for the new page.
	 * 
	 * @param page
	 */
private void updateForPage(IWizardPage page) {
    // ensure this page belongs to the current wizard
    if (wizard != page.getWizard()) {
        setWizard(page.getWizard());
    }
    // (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(//$NON-NLS-1$
        JFaceResources.getString("WizardDialog.missingSetControl"), 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();
}
Also used : IWizardPage(org.eclipse.jface.wizard.IWizardPage)

Example 4 with IWizardPage

use of org.eclipse.jface.wizard.IWizardPage in project translationstudio8 by heartsome.

the class TSWizardDialog method nextPressed.

/**
	 * The Next button has been pressed.
	 */
protected void nextPressed() {
    IWizardPage page = currentPage.getNextPage();
    if (page == null) {
        // something must have happened getting the next page
        return;
    }
    // show the next page
    showPage(page);
}
Also used : IWizardPage(org.eclipse.jface.wizard.IWizardPage)

Example 5 with IWizardPage

use of org.eclipse.jface.wizard.IWizardPage in project translationstudio8 by heartsome.

the class TSWizardDialog method createPageControls.

/**
	 * Allow the wizard's pages to pre-create their page controls. This allows
	 * the wizard dialog to open to the correct size.
	 */
private void createPageControls() {
    // Allow the wizard pages to precreate their page controls
    // This allows the wizard to open to the correct size
    wizard.createPageControls(pageContainer);
    // Ensure that all of the created pages are initially not visible
    IWizardPage[] pages = wizard.getPages();
    for (int i = 0; i < pages.length; i++) {
        IWizardPage page = pages[i];
        if (page.getControl() != null) {
            page.getControl().setVisible(false);
        }
    }
}
Also used : IWizardPage(org.eclipse.jface.wizard.IWizardPage) Point(org.eclipse.swt.graphics.Point)

Aggregations

IWizardPage (org.eclipse.jface.wizard.IWizardPage)34 InvocationTargetException (java.lang.reflect.InvocationTargetException)4 Control (org.eclipse.swt.widgets.Control)4 ExecTaskWithProgress (com.cubrid.common.ui.spi.progress.ExecTaskWithProgress)3 DBClasses (com.cubrid.cubridmanager.core.cubrid.table.model.DBClasses)3 IProgressMonitor (org.eclipse.core.runtime.IProgressMonitor)3 IPageChangedListener (org.eclipse.jface.dialogs.IPageChangedListener)3 IPageChangingListener (org.eclipse.jface.dialogs.IPageChangingListener)3 IRunnableWithProgress (org.eclipse.jface.operation.IRunnableWithProgress)3 IOpenListener (org.eclipse.jface.viewers.IOpenListener)3 ISelectionChangedListener (org.eclipse.jface.viewers.ISelectionChangedListener)3 OpenEvent (org.eclipse.jface.viewers.OpenEvent)3 SelectionChangedEvent (org.eclipse.jface.viewers.SelectionChangedEvent)3 Point (org.eclipse.swt.graphics.Point)3 GridData (org.eclipse.swt.layout.GridData)3 GridLayout (org.eclipse.swt.layout.GridLayout)3 Composite (org.eclipse.swt.widgets.Composite)3 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)2 TableViewer (org.eclipse.jface.viewers.TableViewer)2 WizardPage (org.eclipse.jface.wizard.WizardPage)2