Search in sources :

Example 31 with IWizardPage

use of org.eclipse.jface.wizard.IWizardPage in project cubrid-manager by CUBRID.

the class SelectTablesPage method pageChanged.

/**
	 * @see org.eclipse.jface.dialogs.IPageChangedListener#pageChanged(org.eclipse.jface.dialogs.PageChangedEvent)
	 * @param event PageChangedEvent
	 */
public void pageChanged(PageChangedEvent event) {
    IWizardPage page = (IWizardPage) event.getSelectedPage();
    if (page.getName().equals(PAGENAME)) {
        SelectDatabasePage selectDatabasePage = (SelectDatabasePage) getWizard().getPage(SelectDatabasePage.PAGENAME);
        String dbName = selectDatabasePage.getDbName();
        String dbaPassword = selectDatabasePage.getDbaPassword();
        if (host != null && host.isValid()) {
            String ip = host.getIp();
            String port = host.getPort();
            String userName = host.getUserName();
            String password = host.getPassword();
            GetAllClassesTaskExecutor taskExcutor = new GetAllClassesTaskExecutor(getShell(), ip, port, userName, password, dbName, dbaPassword);
            new ExecTaskWithProgress(taskExcutor).exec();
            if (taskExcutor.isSuccess()) {
                DBClasses dbClasses = taskExcutor.getDBClasses();
                selectTableComp.fillTableViewer(dbClasses);
                selectTableComp.setReplAllTables(master.isReplicateAll());
                selectTableComp.setSelectedTableList(master.getReplicatedClassList());
                setErrorMessage(null);
                setPageComplete(isEditable);
            } else {
                setErrorMessage(Messages.errPreviousPage);
                setPageComplete(false);
            }
        }
    }
}
Also used : ExecTaskWithProgress(com.cubrid.common.ui.spi.progress.ExecTaskWithProgress) IWizardPage(org.eclipse.jface.wizard.IWizardPage) DBClasses(com.cubrid.cubridmanager.core.cubrid.table.model.DBClasses) GetAllClassesTaskExecutor(com.cubrid.cubridmanager.ui.replication.control.GetAllClassesTaskExecutor)

Example 32 with IWizardPage

use of org.eclipse.jface.wizard.IWizardPage in project tdi-studio-se by Talend.

the class GenericWizardDialog method getForm.

private Form getForm() {
    Form form = null;
    IWizardPage currentPage = getCurrentPage();
    if (currentPage instanceof GenericWizardPage) {
        GenericWizardPage genericWizardPage = (GenericWizardPage) currentPage;
        form = genericWizardPage.getForm();
    }
    return form;
}
Also used : Form(org.talend.daikon.properties.presentation.Form) IWizardPage(org.eclipse.jface.wizard.IWizardPage)

Example 33 with IWizardPage

use of org.eclipse.jface.wizard.IWizardPage in project tesb-studio-se by Talend.

the class OpenWSDLPage method getDestinationPath.

/**
     * Gets the path to save the Service node. Created by Marvin Wang on May 11, 2012.
     *
     * @return
     */
protected IPath getDestinationPath() {
    IWizardPage previousPage = this.getPreviousPage();
    if (previousPage instanceof PropertiesWizardPage) {
        PropertiesWizardPage wizardPage = (PropertiesWizardPage) previousPage;
        pathToSave = wizardPage.getDestinationPath();
    }
    return pathToSave;
}
Also used : PropertiesWizardPage(org.talend.metadata.managment.ui.wizard.PropertiesWizardPage) IWizardPage(org.eclipse.jface.wizard.IWizardPage)

Example 34 with IWizardPage

use of org.eclipse.jface.wizard.IWizardPage in project bndtools by bndtools.

the class TemplateSelectionWizardPage method createControl.

@Override
public void createControl(Composite parent) {
    //$NON-NLS-1$
    setImageDescriptor(Plugin.imageDescriptorFromPlugin("icons/bndtools-wizban.png"));
    GridData gd;
    Composite composite = new Composite(parent, SWT.NULL);
    setControl(composite);
    composite.setLayout(new GridLayout(1, false));
    Control headerControl = createHeaderControl(composite);
    if (headerControl != null)
        headerControl.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
    new Label(composite, SWT.NONE).setText("Select Template:");
    tree = new Tree(composite, SWT.BORDER | SWT.FULL_SELECTION);
    gd = new GridData(SWT.FILL, SWT.FILL, true, true);
    gd.heightHint = 150;
    tree.setLayoutData(gd);
    defaultTemplateImage = AbstractUIPlugin.imageDescriptorFromPlugin(Plugin.PLUGIN_ID, "icons/template.gif").createImage(parent.getDisplay());
    viewer = new TreeViewer(tree);
    contentProvider = new RepoTemplateContentProvider(false);
    viewer.setContentProvider(contentProvider);
    viewer.setLabelProvider(new RepoTemplateLabelProvider(loadedImages, defaultTemplateImage));
    viewer.addFilter(latestFilter);
    setTemplates(emptyTemplate != null ? Collections.singletonList(emptyTemplate) : Collections.<Template>emptyList());
    btnLatestOnly = new Button(composite, SWT.CHECK);
    btnLatestOnly.setText("Show latest versions only");
    btnLatestOnly.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, false));
    btnLatestOnly.setSelection(true);
    new Label(composite, SWT.NONE).setText("Description:");
    Composite cmpDescription = new Composite(composite, SWT.BORDER);
    cmpDescription.setBackground(tree.getBackground());
    txtDescription = new ScrolledFormText(cmpDescription, SWT.V_SCROLL | SWT.H_SCROLL, false);
    FormText formText = new FormText(txtDescription, SWT.NO_FOCUS);
    txtDescription.setFormText(formText);
    txtDescription.setBackground(tree.getBackground());
    formText.setBackground(tree.getBackground());
    formText.setForeground(tree.getForeground());
    formText.setFont("fixed", JFaceResources.getTextFont());
    formText.setFont("italic", JFaceResources.getFontRegistry().getItalic(""));
    GridData gd_cmpDescription = new GridData(SWT.FILL, SWT.FILL, true, true);
    gd_cmpDescription.heightHint = 25;
    cmpDescription.setLayoutData(gd_cmpDescription);
    GridLayout layout_cmpDescription = new GridLayout(1, false);
    cmpDescription.setLayout(layout_cmpDescription);
    GridData gd_txtDescription = new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1);
    gd_txtDescription.heightHint = 25;
    txtDescription.setLayoutData(gd_txtDescription);
    Hyperlink linkRetina = new Hyperlink(composite, SWT.NONE);
    linkRetina.setText("Why is this text blurred?");
    linkRetina.setUnderlined(true);
    linkRetina.setForeground(JFaceColors.getHyperlinkText(getShell().getDisplay()));
    linkRetina.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, false));
    viewer.addSelectionChangedListener(new ISelectionChangedListener() {

        @Override
        public void selectionChanged(SelectionChangedEvent event) {
            Object element = ((IStructuredSelection) viewer.getSelection()).getFirstElement();
            setTemplate(element instanceof Template ? (Template) element : null);
            getContainer().updateButtons();
        }
    });
    viewer.addOpenListener(new IOpenListener() {

        @Override
        public void open(OpenEvent event) {
            Object element = ((IStructuredSelection) viewer.getSelection()).getFirstElement();
            setTemplate(element instanceof Template ? (Template) element : null);
            getContainer().updateButtons();
            IWizardPage nextPage = getNextPage();
            if (nextPage != null && selected != null)
                getContainer().showPage(nextPage);
        }
    });
    btnLatestOnly.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            boolean latestOnly = btnLatestOnly.getSelection();
            if (latestOnly)
                viewer.addFilter(latestFilter);
            else
                viewer.removeFilter(latestFilter);
        }
    });
    linkRetina.addHyperlinkListener(new HyperlinkAdapter() {

        @Override
        public void linkActivated(HyperlinkEvent ev) {
            try {
                IWorkbenchBrowserSupport browser = PlatformUI.getWorkbench().getBrowserSupport();
                browser.getExternalBrowser().openURL(new URL("https://github.com/bndtools/bndtools/wiki/Blurry-Form-Text-on-High-Resolution-Displays"));
            } catch (Exception e) {
                log.log(new Status(IStatus.ERROR, Plugin.PLUGIN_ID, 0, "Browser open error", e));
            }
        }
    });
    txtDescription.getFormText().addHyperlinkListener(new HyperlinkAdapter() {

        @Override
        public void linkActivated(HyperlinkEvent ev) {
            try {
                PlatformUI.getWorkbench().getBrowserSupport().getExternalBrowser().openURL(new URL((String) ev.getHref()));
            } catch (Exception ex) {
                log.log(new Status(IStatus.ERROR, Plugin.PLUGIN_ID, 0, "Browser open error", ex));
            }
        }
    });
}
Also used : HyperlinkEvent(org.eclipse.ui.forms.events.HyperlinkEvent) TreeViewer(org.eclipse.jface.viewers.TreeViewer) Label(org.eclipse.swt.widgets.Label) SelectionChangedEvent(org.eclipse.jface.viewers.SelectionChangedEvent) ScrolledFormText(org.eclipse.ui.forms.widgets.ScrolledFormText) URL(java.net.URL) Template(org.bndtools.templating.Template) GridLayout(org.eclipse.swt.layout.GridLayout) Control(org.eclipse.swt.widgets.Control) Button(org.eclipse.swt.widgets.Button) SelectionEvent(org.eclipse.swt.events.SelectionEvent) Tree(org.eclipse.swt.widgets.Tree) IStatus(org.eclipse.core.runtime.IStatus) Status(org.eclipse.core.runtime.Status) Composite(org.eclipse.swt.widgets.Composite) FormText(org.eclipse.ui.forms.widgets.FormText) ScrolledFormText(org.eclipse.ui.forms.widgets.ScrolledFormText) ISelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) InvalidSyntaxException(org.osgi.framework.InvalidSyntaxException) InvocationTargetException(java.lang.reflect.InvocationTargetException) IOException(java.io.IOException) IOpenListener(org.eclipse.jface.viewers.IOpenListener) GridData(org.eclipse.swt.layout.GridData) IWizardPage(org.eclipse.jface.wizard.IWizardPage) IWorkbenchBrowserSupport(org.eclipse.ui.browser.IWorkbenchBrowserSupport) Hyperlink(org.eclipse.ui.forms.widgets.Hyperlink) OpenEvent(org.eclipse.jface.viewers.OpenEvent) HyperlinkAdapter(org.eclipse.ui.forms.events.HyperlinkAdapter)

Example 35 with IWizardPage

use of org.eclipse.jface.wizard.IWizardPage in project bndtools by bndtools.

the class RunExportSelectionPage method createControl.

public void createControl(Composite parent) {
    Composite container = new Composite(parent, SWT.NONE);
    setControl(container);
    container.setLayout(new GridLayout(1, false));
    table = new Table(container, SWT.BORDER | SWT.FULL_SELECTION | SWT.SINGLE);
    table.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
    viewer = new TableViewer(table);
    viewer.setContentProvider(ArrayContentProvider.getInstance());
    viewer.setLabelProvider(new ConfigElementLabelProvider(table.getDisplay(), null));
    viewer.addSelectionChangedListener(new ISelectionChangedListener() {

        public void selectionChanged(SelectionChangedEvent event) {
            ISelection sel = viewer.getSelection();
            if (sel.isEmpty())
                setSelectedNode(null);
            else {
                IConfigurationElement elem = (IConfigurationElement) ((IStructuredSelection) sel).getFirstElement();
                IWizardNode node = nodeCache.get(elem);
                if (node == null) {
                    node = new RunExportWizardNode(getShell(), elem, model, bndProject);
                    nodeCache.put(elem, node);
                }
                setSelectedNode(node);
            }
        }
    });
    viewer.addOpenListener(new IOpenListener() {

        public void open(OpenEvent event) {
            IWizardPage nextPage = getNextPage();
            if (nextPage != null)
                getContainer().showPage(nextPage);
        }
    });
    viewer.setInput(elements);
}
Also used : Table(org.eclipse.swt.widgets.Table) Composite(org.eclipse.swt.widgets.Composite) ISelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener) SelectionChangedEvent(org.eclipse.jface.viewers.SelectionChangedEvent) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) IConfigurationElement(org.eclipse.core.runtime.IConfigurationElement) IWizardNode(org.eclipse.jface.wizard.IWizardNode) GridLayout(org.eclipse.swt.layout.GridLayout) IOpenListener(org.eclipse.jface.viewers.IOpenListener) GridData(org.eclipse.swt.layout.GridData) ConfigElementLabelProvider(org.bndtools.core.ui.ConfigElementLabelProvider) ISelection(org.eclipse.jface.viewers.ISelection) IWizardPage(org.eclipse.jface.wizard.IWizardPage) TableViewer(org.eclipse.jface.viewers.TableViewer) OpenEvent(org.eclipse.jface.viewers.OpenEvent)

Aggregations

IWizardPage (org.eclipse.jface.wizard.IWizardPage)36 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 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 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)2