Search in sources :

Example 1 with TalendZipFileExportWizard

use of org.talend.repository.ui.wizards.newproject.copyfromeclipse.TalendZipFileExportWizard 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

CoreException (org.eclipse.core.runtime.CoreException)1 IProgressMonitor (org.eclipse.core.runtime.IProgressMonitor)1 Job (org.eclipse.core.runtime.jobs.Job)1 WizardDialog (org.eclipse.jface.wizard.WizardDialog)1 Shell (org.eclipse.swt.widgets.Shell)1 IBrandingService (org.talend.core.ui.branding.IBrandingService)1 TalendZipFileExportWizard (org.talend.repository.ui.wizards.newproject.copyfromeclipse.TalendZipFileExportWizard)1