Search in sources :

Example 16 with IWizardPage

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

the class TableLabelProvider method pageChanged.

/**
	 * Call this method when from a page to a page
	 *
	 * @param event the page changed event
	 */
public void pageChanged(PageChangedEvent event) {
    IWizardPage page = (IWizardPage) event.getSelectedPage();
    if (page.getName().equals(PAGENAME)) {
        setMessage(null);
        parsedDatabaseList = parseDatabases();
        priviewViewer.setInput(parsedDatabaseList);
        priviewViewer.refresh();
        if (parsedDatabaseList.size() == 0) {
            setErrorMessage(Messages.errNoParseDatabase);
            setPageComplete(false);
        } else {
            setErrorMessage(null);
            setPageComplete(true);
        }
        CommonUITool.packTable(priviewViewer.getTable(), 20, 200);
    }
}
Also used : IWizardPage(org.eclipse.jface.wizard.IWizardPage)

Example 17 with IWizardPage

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

the class LocalRepositorySelectionPage method createControl.

public void createControl(Composite parent) {
    setTitle("Select Local Repository");
    setMessage("Bundle will be imported into the selected repository.");
    Table table = new Table(parent, SWT.BORDER | SWT.SINGLE | SWT.FULL_SELECTION);
    final TableViewer viewer = new TableViewer(table);
    viewer.setContentProvider(new RepositoryTreeContentProvider());
    viewer.setLabelProvider(new RepositoryTreeLabelProvider(false));
    viewer.setFilters(new ViewerFilter[] { new ViewerFilter() {

        @Override
        public boolean select(Viewer viewer, Object parentElement, Object element) {
            return (element instanceof RepositoryPlugin) && ((RepositoryPlugin) element).canWrite();
        }
    } });
    try {
        Workspace workspace = Central.getWorkspace();
        viewer.setInput(workspace);
        if (selectedRepository != null)
            viewer.setSelection(new StructuredSelection(selectedRepository));
        validate(workspace);
    } catch (Exception e) {
        logger.logError("Error querying local repositories", e);
        setErrorMessage("Error querying local repositories, see log for details.");
    }
    // LISTENERS
    viewer.addSelectionChangedListener(new ISelectionChangedListener() {

        public void selectionChanged(SelectionChangedEvent event) {
            IStructuredSelection selection = (IStructuredSelection) viewer.getSelection();
            setSelectedRepository((RepositoryPlugin) selection.getFirstElement());
        }
    });
    viewer.addOpenListener(new IOpenListener() {

        public void open(OpenEvent evt) {
            IStructuredSelection selection = (IStructuredSelection) viewer.getSelection();
            setSelectedRepository((RepositoryPlugin) selection.getFirstElement());
            IWizardPage nextPage = getNextPage();
            if (nextPage != null)
                getContainer().showPage(nextPage);
        }
    });
    setControl(table);
}
Also used : Table(org.eclipse.swt.widgets.Table) ViewerFilter(org.eclipse.jface.viewers.ViewerFilter) RepositoryTreeContentProvider(bndtools.model.repo.RepositoryTreeContentProvider) ISelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener) StructuredSelection(org.eclipse.jface.viewers.StructuredSelection) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) RepositoryPlugin(aQute.bnd.service.RepositoryPlugin) TableViewer(org.eclipse.jface.viewers.TableViewer) Viewer(org.eclipse.jface.viewers.Viewer) SelectionChangedEvent(org.eclipse.jface.viewers.SelectionChangedEvent) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) RepositoryTreeLabelProvider(bndtools.model.repo.RepositoryTreeLabelProvider) IOpenListener(org.eclipse.jface.viewers.IOpenListener) IWizardPage(org.eclipse.jface.wizard.IWizardPage) TableViewer(org.eclipse.jface.viewers.TableViewer) Workspace(aQute.bnd.build.Workspace) OpenEvent(org.eclipse.jface.viewers.OpenEvent)

Example 18 with IWizardPage

use of org.eclipse.jface.wizard.IWizardPage in project Palladio-Editors-Sirius by PalladioSimulator.

the class NewModelWizard method addPages.

@Override
public void addPages() {
    super.addPages();
    addPage(this.modelCreationPage);
    addPage(this.representationCreationPage);
    for (IWizardPage page : additionalPages) {
        addPage(page);
    }
}
Also used : IWizardPage(org.eclipse.jface.wizard.IWizardPage)

Example 19 with IWizardPage

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

the class TSWizardDialog method backPressed.

/**
	 * The Back button has been pressed.
	 */
protected void backPressed() {
    IWizardPage page = currentPage.getPreviousPage();
    if (page == null) {
        // should never happen since we have already visited the page
        return;
    }
    // set flag to indicate that we are moving back
    isMovingToPreviousPage = true;
    // show the page
    showPage(page);
}
Also used : IWizardPage(org.eclipse.jface.wizard.IWizardPage)

Example 20 with IWizardPage

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

the class NewTermDbBaseInfoPage method getNextPage.

public IWizardPage getNextPage() {
    WizardPage nextPage = (WizardPage) super.getNextPage();
    IRunnableWithProgress runnable = new IRunnableWithProgress() {

        public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
            if (canCreateDb(monitor) != null) {
                throw new InterruptedException();
            }
        }
    };
    try {
        getContainer().run(true, true, runnable);
    } catch (InvocationTargetException e) {
        logger.error("", e);
        e.printStackTrace();
        return null;
    } catch (InterruptedException e) {
        e.printStackTrace();
        return null;
    }
    nextPage.setErrorMessage(null);
    return nextPage;
}
Also used : IProgressMonitor(org.eclipse.core.runtime.IProgressMonitor) IWizardPage(org.eclipse.jface.wizard.IWizardPage) WizardPage(org.eclipse.jface.wizard.WizardPage) InvocationTargetException(java.lang.reflect.InvocationTargetException) IRunnableWithProgress(org.eclipse.jface.operation.IRunnableWithProgress)

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