Search in sources :

Example 16 with WizardPage

use of org.eclipse.jface.wizard.WizardPage in project webtools.servertools by eclipse.

the class GenericServerTemplate method addPages.

public void addPages(Wizard wizard) {
    WizardPage page = createPage(0);
    page.setTitle(Messages.pageTitle);
    page.setDescription(Messages.pageDescription);
    wizard.addPage(page);
    markPagesAdded();
}
Also used : WizardPage(org.eclipse.jface.wizard.WizardPage)

Example 17 with WizardPage

use of org.eclipse.jface.wizard.WizardPage in project jbosstools-openshift by jbosstools.

the class WizardHandleAwareFragment method getWizardContainer.

/**
 * Helper method to extract wizard container from the handle.
 * May return null, if composite is not yet created or if wizard is disposed.
 *
 * @return
 */
protected IWizardContainer getWizardContainer() {
    if (!(handle instanceof WizardPage)) {
        return null;
    }
    WizardPage page = (WizardPage) handle;
    if (page.getShell() == null || page.getShell().isDisposed()) {
        return null;
    }
    IWizard wizard = page.getWizard();
    return (wizard == null) ? null : wizard.getContainer();
}
Also used : WizardPage(org.eclipse.jface.wizard.WizardPage) IWizard(org.eclipse.jface.wizard.IWizard)

Example 18 with WizardPage

use of org.eclipse.jface.wizard.WizardPage in project pentaho-kettle by pentaho.

the class CreateDatabaseWizard method createAndRunDatabaseWizard.

/**
 * Shows a wizard that creates a new database connection...
 *
 * @param shell
 * @param props
 * @param databases
 * @return DatabaseMeta when finished or null when canceled
 */
public DatabaseMeta createAndRunDatabaseWizard(Shell shell, PropsUI props, List<DatabaseMeta> databases) {
    DatabaseMeta newDBInfo = new DatabaseMeta();
    final CreateDatabaseWizardPage1 page1 = new CreateDatabaseWizardPage1("1", props, newDBInfo, databases);
    final CreateDatabaseWizardPageInformix pageifx = new CreateDatabaseWizardPageInformix("ifx", props, newDBInfo);
    final CreateDatabaseWizardPageJDBC pagejdbc = new CreateDatabaseWizardPageJDBC("jdbc", props, newDBInfo);
    final CreateDatabaseWizardPageOCI pageoci = new CreateDatabaseWizardPageOCI("oci", props, newDBInfo);
    final CreateDatabaseWizardPageODBC pageodbc = new CreateDatabaseWizardPageODBC("odbc", props, newDBInfo);
    final CreateDatabaseWizardPageOracle pageoracle = new CreateDatabaseWizardPageOracle("oracle", props, newDBInfo);
    final CreateDatabaseWizardPageGeneric pageGeneric = new CreateDatabaseWizardPageGeneric("generic", props, newDBInfo);
    final CreateDatabaseWizardPage2 page2 = new CreateDatabaseWizardPage2("2", props, newDBInfo);
    for (PluginInterface pluginInterface : PluginRegistry.getInstance().getPlugins(DatabasePluginType.class)) {
        try {
            Object plugin = PluginRegistry.getInstance().loadClass(pluginInterface);
            if (plugin instanceof WizardPageFactory) {
                WizardPageFactory factory = (WizardPageFactory) plugin;
                additionalPages.add(factory.createWizardPage(props, newDBInfo));
            }
        } catch (KettlePluginException kpe) {
        // Don't do anything
        }
    }
    // set to false for safety only
    wizardFinished = false;
    Wizard wizard = new Wizard() {

        /**
         * @see org.eclipse.jface.wizard.Wizard#performFinish()
         */
        public boolean performFinish() {
            wizardFinished = true;
            return true;
        }

        /**
         * @see org.eclipse.jface.wizard.Wizard#canFinish()
         */
        public boolean canFinish() {
            return page2.canFinish();
        }
    };
    wizard.addPage(page1);
    wizard.addPage(pageoci);
    wizard.addPage(pageodbc);
    wizard.addPage(pagejdbc);
    wizard.addPage(pageoracle);
    wizard.addPage(pageifx);
    wizard.addPage(pageGeneric);
    for (WizardPage page : additionalPages) {
        wizard.addPage(page);
    }
    wizard.addPage(page2);
    WizardDialog wd = new WizardDialog(shell, wizard);
    WizardDialog.setDefaultImage(GUIResource.getInstance().getImageWizard());
    wd.setMinimumPageSize(700, 400);
    wd.updateSize();
    wd.open();
    if (!wizardFinished) {
        newDBInfo = null;
    }
    return newDBInfo;
}
Also used : KettlePluginException(org.pentaho.di.core.exception.KettlePluginException) PluginInterface(org.pentaho.di.core.plugins.PluginInterface) DatabaseMeta(org.pentaho.di.core.database.DatabaseMeta) WizardPage(org.eclipse.jface.wizard.WizardPage) Wizard(org.eclipse.jface.wizard.Wizard) WizardDialog(org.eclipse.jface.wizard.WizardDialog)

Example 19 with WizardPage

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

the class AbstractNativeToolWizard method updateErrorMessage.

void updateErrorMessage() {
    WizardPage currentPage = (WizardPage) getStartingPage();
    if (isNativeClientHomeRequired()) {
        String clientHomeId = getSettings().getDataSourceContainer().getConnectionConfiguration().getClientHomeId();
        List<DBPNativeClientLocation> nativeClientLocations = getSettings().getDataSourceContainer().getDriver().getNativeClientLocations();
        if (CommonUtils.isEmpty(clientHomeId)) {
            if (nativeClientLocations != null && !nativeClientLocations.isEmpty()) {
                settings.setClientHome(nativeClientLocations.get(0));
            } else {
                settings.setClientHome(null);
            }
            if (settings.getClientHome() == null) {
                currentPage.setErrorMessage(TaskNativeUIMessages.tools_wizard_message_no_client_home);
                getContainer().updateMessage();
                return;
            }
        } else {
            DBPNativeClientLocation clientHome = DBUtils.findObject(nativeClientLocations, clientHomeId);
            if (clientHome == null) {
                clientHome = getSettings().findNativeClientHome(clientHomeId);
            }
            if (clientHome == null) {
                // Make local client home from location
                clientHome = new LocalNativeClientLocation(clientHomeId, clientHomeId);
            }
            settings.setClientHome(clientHome);
        }
        if (settings.getClientHome() == null) {
            currentPage.setErrorMessage(NLS.bind(TaskNativeUIMessages.tools_wizard_message_client_home_not_found, clientHomeId));
        } else {
            currentPage.setErrorMessage(null);
        }
        getContainer().updateMessage();
    }
}
Also used : DBPNativeClientLocation(org.jkiss.dbeaver.model.connection.DBPNativeClientLocation) WizardPage(org.eclipse.jface.wizard.WizardPage) LocalNativeClientLocation(org.jkiss.dbeaver.model.connection.LocalNativeClientLocation)

Example 20 with WizardPage

use of org.eclipse.jface.wizard.WizardPage in project yamcs-studio by yamcs.

the class NewOPIImageLibExampleWizard method addPages.

@Override
public void addPages() {
    super.addPages();
    setWindowTitle(WINDOW_TITLE);
    addPage(new WizardPage(WIZARD_PAGE) {

        @Override
        public void createControl(Composite parent) {
            setTitle(WIZARD_PAGE_TITLE);
            setDescription(WIZARD_PAGE_DESCRIPTION);
            var container = new Composite(parent, SWT.None);
            container.setLayout(new GridLayout());
            setControl(container);
            var label = new Label(container, SWT.WRAP);
            var gd = new GridData();
            gd.widthHint = 500;
            label.setLayoutData(gd);
            label.setText("OPI Image Library will be imported to your workspace. " + NLS.bind("If there is already a project named \"{0}\" in your workspace," + "the import will fail. ", InstallOPIImageLibraryAction.PROJECT_NAME) + "Please rename or delete it and import again.");
        }
    });
}
Also used : GridLayout(org.eclipse.swt.layout.GridLayout) Composite(org.eclipse.swt.widgets.Composite) WizardPage(org.eclipse.jface.wizard.WizardPage) Label(org.eclipse.swt.widgets.Label) GridData(org.eclipse.swt.layout.GridData)

Aggregations

WizardPage (org.eclipse.jface.wizard.WizardPage)25 IWizardPage (org.eclipse.jface.wizard.IWizardPage)6 Composite (org.eclipse.swt.widgets.Composite)6 Label (org.eclipse.swt.widgets.Label)6 GridData (org.eclipse.swt.layout.GridData)5 GridLayout (org.eclipse.swt.layout.GridLayout)5 OptionTemplateWizardPage (org.eclipse.gemoc.commons.eclipse.pde.wizards.pages.pde.ui.templates.OptionTemplateWizardPage)3 InvocationTargetException (java.lang.reflect.InvocationTargetException)2 IProgressMonitor (org.eclipse.core.runtime.IProgressMonitor)2 TemplateOption (org.eclipse.gemoc.commons.eclipse.pde.wizards.pages.pde.ui.templates.TemplateOption)2 IRunnableWithProgress (org.eclipse.jface.operation.IRunnableWithProgress)2 IWizardContainer (org.eclipse.jface.wizard.IWizardContainer)2 Optional (com.google.common.base.Optional)1 FluentIterable.from (com.google.common.collect.FluentIterable.from)1 Sets.newTreeSet (com.google.common.collect.Sets.newTreeSet)1 Ints (com.google.common.primitives.Ints)1 Inject (com.google.inject.Inject)1 Arrays (java.util.Arrays)1 Collection (java.util.Collection)1 Collections.singletonList (java.util.Collections.singletonList)1