Search in sources :

Example 66 with WizardDialog

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

the class CreateGenericConnectionAction method doRun.

@Override
protected void doRun() {
    IWizard wizard = new GenericConnWizard(PlatformUI.getWorkbench(), creation, repositoryNode, getExistingNames());
    WizardDialog wizardDialog = new GenericWizardDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), wizard, new GenericWizardInternalService().getComponentService());
    if (Platform.getOS().equals(Platform.OS_LINUX)) {
        wizardDialog.setPageSize(getWizardWidth(), getWizardHeight() + 80);
    }
    wizardDialog.create();
    wizardDialog.open();
}
Also used : IWizard(org.eclipse.jface.wizard.IWizard) GenericWizardDialog(org.talend.repository.generic.ui.common.GenericWizardDialog) GenericWizardInternalService(org.talend.repository.generic.internal.service.GenericWizardInternalService) GenericWizardDialog(org.talend.repository.generic.ui.common.GenericWizardDialog) WizardDialog(org.eclipse.jface.wizard.WizardDialog) GenericConnWizard(org.talend.repository.generic.ui.GenericConnWizard)

Example 67 with WizardDialog

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

the class ImportDemoItemAction method doRun.

@Override
protected void doRun() {
    if (ProxyRepositoryFactory.getInstance().isUserReadOnlyOnCurrentProject()) {
        return;
    }
    // qli modified to fix the bug "6999".
    IRepositoryView repositoryView = RepositoryManagerHelper.findRepositoryView();
    if (repositoryView != null && repositoryView.getViewer() instanceof TreeViewer) {
        ((TreeViewer) repositoryView.getViewer()).getTree().setFocus();
    }
    ISelection selection = this.getSelection();
    RepositoryNode rNode = null;
    if (toolbarAction) {
        if (repositoryView != null) {
            selection = repositoryView.getViewer().getSelection();
        }
    } else if ((selection instanceof IStructuredSelection) && (((IStructuredSelection) selection).getFirstElement() instanceof RepositoryNode)) {
        Object o = ((IStructuredSelection) selection).getFirstElement();
        if (o instanceof RepositoryNode) {
            rNode = (RepositoryNode) o;
        }
    }
    final List<DemoProjectBean> demoProjectList = ImportProjectsUtilities.getAllDemoProjects();
    ImportDemoProjectItemsWizard wizard = new ImportDemoProjectItemsWizard(demoProjectList);
    wizard.setWindowTitle(IMPORT_DEMO);
    wizard.init(PlatformUI.getWorkbench(), (IStructuredSelection) selection);
    Shell activeShell = Display.getCurrent().getActiveShell();
    WizardDialog dialog = new WizardDialog(activeShell, wizard);
    dialog.open();
}
Also used : Shell(org.eclipse.swt.widgets.Shell) DemoProjectBean(org.talend.repository.ui.actions.importproject.DemoProjectBean) TreeViewer(org.eclipse.jface.viewers.TreeViewer) ISelection(org.eclipse.jface.viewers.ISelection) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) IRepositoryView(org.talend.repository.ui.views.IRepositoryView) RepositoryNode(org.talend.repository.model.RepositoryNode) ImportDemoProjectItemsWizard(org.talend.repository.ui.actions.importproject.ImportDemoProjectItemsWizard) WizardDialog(org.eclipse.jface.wizard.WizardDialog)

Example 68 with WizardDialog

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

the class ImportDemoProjectPage method prefromFinish.

public boolean prefromFinish() {
    final DemoProjectBean selectPro = this.demoProjectList.get(selectedDemoProjectIndex);
    NewImportProjectWizard newPrjWiz = new NewImportProjectWizard();
    WizardDialog newProjectDialog = new WizardDialog(getShell(), newPrjWiz);
    //$NON-NLS-1$
    newProjectDialog.setTitle(Messages.getString("NewImportProjectWizard.windowTitle"));
    if (newProjectDialog.open() == Window.OK) {
        projectName = newPrjWiz.getName().trim().replace(' ', '_');
        // final String demoProjName = selectPro.getProjectName();
        //
        ProgressDialog progressDialog = new ProgressDialog(getShell()) {

            private IProgressMonitor monitorWrap;

            @Override
            public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
                monitorWrap = new EventLoopProgressMonitor(monitor);
                try {
                    // }
                    if (null == selectPro) {
                        //$NON-NLS-1$
                        throw new IOException("cannot find selected demo project");
                    }
                    ImportProjectsUtilities.importDemoProject(getShell(), projectName, selectPro, monitor);
                } catch (Exception e1) {
                    projectName = null;
                    throw new InvocationTargetException(e1);
                }
                monitorWrap.done();
            }
        };
        try {
            progressDialog.executeProcess();
        } catch (InvocationTargetException e1) {
            projectName = null;
            MessageBoxExceptionHandler.process(e1.getTargetException(), getShell());
        } catch (InterruptedException e1) {
            projectName = null;
        }
    }
    return true;
}
Also used : IProgressMonitor(org.eclipse.core.runtime.IProgressMonitor) NewImportProjectWizard(org.talend.repository.ui.login.NewImportProjectWizard) EventLoopProgressMonitor(org.talend.commons.ui.swt.dialogs.EventLoopProgressMonitor) IOException(java.io.IOException) ProgressDialog(org.talend.commons.ui.swt.dialogs.ProgressDialog) WizardDialog(org.eclipse.jface.wizard.WizardDialog) IOException(java.io.IOException) InvocationTargetException(java.lang.reflect.InvocationTargetException) InvocationTargetException(java.lang.reflect.InvocationTargetException)

Example 69 with WizardDialog

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

the class ImportProjectsAction method run.

public void run() {
    ExternalProjectImportWizard processWizard = new TalendExternalProjectImportWizard();
    // Set the "Copy projects into workspace" value default as true:
    IDialogSettings dialogSettings = processWizard.getDialogSettings();
    if (dialogSettings.get(STORE_COPY_PROJECT) == null) {
        dialogSettings.put(STORE_COPY_PROJECT, true);
    }
    Shell activeShell = Display.getCurrent().getActiveShell();
    WizardDialog dialog = new WizardDialog(activeShell, processWizard);
    processWizard.setWindowTitle(ACTION_TITLE);
    dialog.create();
    dialog.open();
}
Also used : ExternalProjectImportWizard(org.eclipse.ui.wizards.datatransfer.ExternalProjectImportWizard) TalendExternalProjectImportWizard(org.talend.repository.ui.wizards.newproject.copyfromeclipse.TalendExternalProjectImportWizard) Shell(org.eclipse.swt.widgets.Shell) IDialogSettings(org.eclipse.jface.dialogs.IDialogSettings) WizardDialog(org.eclipse.jface.wizard.WizardDialog) TalendExternalProjectImportWizard(org.talend.repository.ui.wizards.newproject.copyfromeclipse.TalendExternalProjectImportWizard)

Example 70 with WizardDialog

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

the class ExportProjectsAsAction method run.

@Override
public void run() {
    // Refresh Navigator view before export operation, see bug 4595
    Job job = new //$NON-NLS-1$
    Job(//$NON-NLS-1$
    Messages.getString("ExportCommandAction.refreshWorkspace")) {

        @Override
        protected IStatus run(IProgressMonitor monitor) {
            monitor.beginTask(ExportProjectsAsAction.this.getToolTipText(), IProgressMonitor.UNKNOWN);
            try {
                ResourcesPlugin.getWorkspace().getRoot().refreshLocal(IResource.DEPTH_INFINITE, null);
            } catch (CoreException e) {
                e.printStackTrace();
            }
            monitor.done();
            return Status.OK_STATUS;
        }
    };
    job.setUser(true);
    job.setPriority(Job.BUILD);
    job.schedule();
    initializeExternalLibraries();
    Shell activeShell = Display.getCurrent().getActiveShell();
    TalendZipFileExportWizard docWizard = new TalendZipFileExportWizard();
    WizardDialog dialog = new WizardDialog(activeShell, docWizard);
    IBrandingService brandingService = (IBrandingService) GlobalServiceRegister.getDefault().getService(IBrandingService.class);
    if (brandingService.isPoweredbyTalend()) {
        //$NON-NLS-1$
        docWizard.setWindowTitle(Messages.getString("ExportProjectsAsAction.actionTitle"));
    } else {
        docWizard.setWindowTitle(Messages.getString("ExportProjectsAsAction.actionTitleForOthers", //$NON-NLS-1$
        brandingService.getShortProductName()));
    }
    dialog.create();
    dialog.open();
    clearExternalLibraries();
}
Also used : IProgressMonitor(org.eclipse.core.runtime.IProgressMonitor) Shell(org.eclipse.swt.widgets.Shell) CoreException(org.eclipse.core.runtime.CoreException) TalendZipFileExportWizard(org.talend.repository.ui.wizards.newproject.copyfromeclipse.TalendZipFileExportWizard) IBrandingService(org.talend.core.ui.branding.IBrandingService) Job(org.eclipse.core.runtime.jobs.Job) WizardDialog(org.eclipse.jface.wizard.WizardDialog)

Aggregations

WizardDialog (org.eclipse.jface.wizard.WizardDialog)115 ISelection (org.eclipse.jface.viewers.ISelection)26 Shell (org.eclipse.swt.widgets.Shell)26 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)25 IWorkbench (org.eclipse.ui.IWorkbench)14 IRepositoryNode (org.talend.repository.model.IRepositoryNode)13 RepositoryNode (org.talend.repository.model.RepositoryNode)13 IPath (org.eclipse.core.runtime.IPath)12 IStatus (org.eclipse.core.runtime.IStatus)10 IWorkbenchPage (org.eclipse.ui.IWorkbenchPage)10 IFile (org.eclipse.core.resources.IFile)9 Status (org.eclipse.core.runtime.Status)7 PartInitException (org.eclipse.ui.PartInitException)7 ArrayList (java.util.ArrayList)6 IProgressMonitor (org.eclipse.core.runtime.IProgressMonitor)6 Composite (org.eclipse.swt.widgets.Composite)6 CoreException (org.eclipse.core.runtime.CoreException)5 IWorkbenchWindow (org.eclipse.ui.IWorkbenchWindow)5 File (java.io.File)4 InvocationTargetException (java.lang.reflect.InvocationTargetException)4