protected void scheduleExportJob() { // NOTE: Any changes to the content here must also be copied to generateAntTask() and // FeatureExportTask final FeatureExportInfo info = new FeatureExportInfo(); info.toDirectory = fPage.doExportToDirectory(); info.useJarFormat = fPage.useJARFormat(); info.exportSource = fPage.doExportSource(); info.exportSourceBundle = fPage.doExportSourceBundles(); info.allowBinaryCycles = fPage.allowBinaryCycles(); info.useWorkspaceCompiledClasses = fPage.useWorkspaceCompiledClasses(); info.destinationDirectory = fPage.getDestination(); info.zipFileName = fPage.getFileName(); if (fPage2 != null && ((FeatureExportWizardPage) fPage).doMultiPlatform()) info.targets = fPage2.getTargets(); info.exportMetadata = ((FeatureExportWizardPage) fPage).doExportMetadata(); info.items = fPage.getSelectedItems(); info.signingInfo = fPage.getSigningInfo(); info.jnlpInfo = ((FeatureExportWizardPage) fPage).getJNLPInfo(); info.qualifier = fPage.getQualifier(); if (((FeatureExportWizardPage) fPage).getCategoryDefinition() != null) info.categoryDefinition = URIUtil.toUnencodedString(((FeatureExportWizardPage) fPage).getCategoryDefinition()); final boolean installAfterExport = fPage.doInstall(); if (installAfterExport) { info.useJarFormat = true; info.exportMetadata = true; if (info.qualifier == null) { // Set the date explicitly since the time can change before the install job runs info.qualifier = QualifierReplacer.getDateQualifier(); } } final FeatureExportOperation job = new FeatureExportOperation(info, PDEUIMessages.FeatureExportJob_name); job.setUser(true); job.setRule(ResourcesPlugin.getWorkspace().getRoot()); job.setProperty(IProgressConstants.ICON_PROPERTY, PDEPluginImages.DESC_FEATURE_OBJ); job.addJobChangeListener( new JobChangeAdapter() { public void done(IJobChangeEvent event) { if (job.hasAntErrors()) { // If there were errors when running the ant scripts, inform the user where the logs // can be found. final File logLocation = new File(info.destinationDirectory, "logs.zip"); // $NON-NLS-1$ if (logLocation.exists()) { PlatformUI.getWorkbench() .getDisplay() .syncExec( new Runnable() { public void run() { AntErrorDialog dialog = new AntErrorDialog(logLocation); dialog.open(); } }); } } else if (event.getResult().isOK() && installAfterExport) { // Install the export into the current running platform RuntimeInstallJob installJob = new RuntimeInstallJob(PDEUIMessages.PluginExportWizard_InstallJobName, info); installJob.setUser(true); installJob.setProperty( IProgressConstants.ICON_PROPERTY, PDEPluginImages.DESC_FEATURE_OBJ); installJob.schedule(); } } }); job.schedule(); }