コード例 #1
0
ファイル: StartupJob.java プロジェクト: nacerix/xmind
 /**
  * Check and recover files opened in the last workbench session. This method consumes 2 ticks from
  * the given progress monitor.
  *
  * @param monitor
  */
 protected void checkAndRecoverFiles(IProgressMonitor monitor) {
   Job subJob = new CheckRecoverFilesJob(workbench);
   subJob.setUser(isUser());
   subJob.setSystem(isSystem());
   subJob.setProgressGroup(monitor, 1);
   subJob.schedule();
   try {
     subJob.join();
   } catch (InterruptedException e) {
   }
 }
コード例 #2
0
 /**
  * This method is called when the user hits the "Finish" button.<br>
  * It runs a job downloading libraries to a given folder.
  *
  * @return true, if perform finish
  * @see org.eclipse.jface.wizard.Wizard#performFinish()
  */
 @Override
 public boolean performFinish() {
   IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
   IProject selectedProject = workspaceRoot.getProject(page1.getChosenProjectName());
   IFolder selectedFolder =
       selectedProject.getFolder(
           page2.getChosenFolder() == null
               ? AggregatedProperties.getDefaultLibFolder(selectedProject)
               : page2.getChosenFolder());
   IProgressMonitor pm = Job.getJobManager().createProgressGroup();
   pm.beginTask(WizardsMessages.PomJavaFolderSynchronizationWizard_monitor_task_name, 100);
   Job job =
       new DownloadAndAddToFolderJob(
           selectedProject, selectedFolder, page1.getSelectedLibraries());
   job.setProgressGroup(pm, 100);
   job.schedule();
   return true;
 }