Java 类org.eclipse.core.runtime.jobs.IJobChangeEvent 实例源码

项目:neoscada    文件:ConfigurationEditorInput.java   
@SuppressWarnings ( "unchecked" )
public void performSave ( final IProgressMonitor monitor )
{
    // provide a copy so that it can be accessed outside the realm
    final UpdateJob updateJob = update ( new HashMap<String, String> ( this.dataMap ), null );

    updateJob.setProgressGroup ( monitor, 2 );

    updateJob.addJobChangeListener ( new JobChangeAdapter () {
        @Override
        public void done ( final IJobChangeEvent event )
        {
            performLoad ( monitor );
        }
    } );

    updateJob.schedule ();
}
项目:pde.source.lookup    文件:ReattachProjectBundleSourcesJob.java   
/**
 * @param name
 */
public ReattachProjectBundleSourcesJob() {
  super("Collecting plugin projects");
  addJobChangeListener(new JobChangeAdapter() {
    @Override
    public void done(IJobChangeEvent event) {
      if (event.getResult().isOK() && pluginContainerEntries != null && pluginContainerEntries.length > 0) {
        // System.err.println("Reattaching bundle sources for " +
        // pluginContainerEntries.length + " plugin containers entries");
        AbstractSourceDownloadJob sourceAttacherJob = new AbstractSourceDownloadJob(
            "Attaching project bundle sources", new CachedSourceLocator()) {
        };
        sourceAttacherJob.queue(pluginContainerEntries);
        sourceAttacherJob.schedule();
      }
    }
  });
}
项目:team-explorer-everywhere    文件:ProjectConnectionManager.java   
@Override
public void done(final IJobChangeEvent event) {
    final IStatus result = event.getResult();
    ProjectManagerRepositoryJob testJob;
    final ProjectManagerRepositoryJob job = (ProjectManagerRepositoryJob) event.getJob();
    final WorkspaceKey workspaceKey = new WorkspaceKey(job.getCachedWorkspace());

    synchronized (connectionLock) {
        testJob = workspaceJobMap.remove(workspaceKey);

        if (testJob == null) {
            log.warn("Could not locate running repository connection job in connection manager."); //$NON-NLS-1$
        } else if (!testJob.equals(job)) {
            log.warn("Multiple repository connection jobs running for same connection key."); //$NON-NLS-1$
        } else if (result.isOK()) {
            log.debug("Project Manager connected project with repository"); //$NON-NLS-1$
        }
    }
}
项目:team-explorer-everywhere    文件:ProjectConnectionManager.java   
@Override
public void done(final IJobChangeEvent event) {
    final IStatus result = event.getResult();
    final ProjectManagerConnectionJob job = (ProjectManagerConnectionJob) event.getJob();
    final URI connectionURI = job.getServerURI();

    synchronized (connectionLock) {
        /*
         * Sanity check: make sure our connection job exists. If not,
         * connections may have been invalidated underneath us.
         */
        final ProjectManagerConnectionJob testJob = serverConnectionJobMap.remove(connectionURI);

        if (testJob == null) {
            log.warn("Could not locate running server connection job in connection manager."); //$NON-NLS-1$
        } else if (!testJob.equals(job)) {
            log.warn("Multiple server connection jobs running for same connection key."); //$NON-NLS-1$
        } else if (result.isOK()) {
            serverManager.getOrCreateServer(job.getConnection());
        }
    }
}
项目:subclipse    文件:SVNTeamProviderType.java   
public synchronized static AutoShareJob getAutoShareJob() {
    if (autoShareJob == null) {
        autoShareJob = new AutoShareJob();
        autoShareJob.addJobChangeListener(new JobChangeAdapter() {
            public void done(IJobChangeEvent event) {
                // Reschedule the job if it has unprocessed projects
                if (!autoShareJob.isQueueEmpty()) {
                    autoShareJob.schedule();
                }
            }
        });
        autoShareJob.setSystem(true);
        autoShareJob.setPriority(Job.SHORT);
        // Must run with the workspace rule to ensure that projects added while we're running
        // can be shared
        autoShareJob.setRule(ResourcesPlugin.getWorkspace().getRoot());
    }
    return autoShareJob;
}
项目:google-cloud-eclipse    文件:DeployConsole.java   
public void setJob(DeployJob newJob) {
  DeployJob oldJob = job;
  job = newJob;
  firePropertyChange(this, PROPERTY_JOB, oldJob, newJob);
  job.addJobChangeListener(new JobChangeAdapter() {
    @Override
    public void done(IJobChangeEvent event) {
      PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
        @Override
        public void run() {
          setName(Messages.getString("job.terminated.template", getName()));
        }
      });
    }
  });
}
项目:google-cloud-eclipse    文件:BuildPath.java   
public static void runContainerResolverJob(IJavaProject javaProject) {
  IEclipseContext context = EclipseContextFactory.getServiceContext(
      FrameworkUtil.getBundle(BuildPath.class).getBundleContext());
  final IEclipseContext childContext =
      context.createChild(LibraryClasspathContainerResolverJob.class.getName());
  childContext.set(IJavaProject.class, javaProject);
  Job job =
      ContextInjectionFactory.make(LibraryClasspathContainerResolverJob.class, childContext);
  job.addJobChangeListener(new JobChangeAdapter() {
    @Override
    public void done(IJobChangeEvent event) {
      childContext.dispose();
    }
  });
  job.schedule();
}
项目:eclipse.jdt.ls    文件:MavenBuildSupportTest.java   
@Test
public void testIgnoreInnerPomChanges() throws Exception {
    IProject project = importMavenProject("archetyped");
    assertEquals("The inner pom should not have been imported", 2, WorkspaceHelper.getAllProjects().size());

    IFile innerPom = project.getFile("src/main/resources/archetype-resources/pom.xml");

    preferences.setUpdateBuildConfigurationStatus(FeatureStatus.automatic);
    boolean[] updateTriggered = new boolean[1];
    IJobChangeListener listener = new JobChangeAdapter() {
        @Override
        public void scheduled(IJobChangeEvent event) {
            if (event.getJob().getName().contains("Update project")) {
                updateTriggered[0] = true;
            }
        }
    };
    try {
        Job.getJobManager().addJobChangeListener(listener);
        projectsManager.fileChanged(innerPom.getRawLocationURI().toString(), CHANGE_TYPE.CHANGED);
        waitForBackgroundJobs();
        assertFalse("Update project should not have been triggered", updateTriggered[0]);
    } finally {
        Job.getJobManager().removeJobChangeListener(listener);
    }
}
项目:tlaplus    文件:TLCModelLaunchDelegate.java   
public void done(IJobChangeEvent event)
{
    String jobName = event.getJob().getName();
    String status = null;
    if (event.getResult().isOK())
    {
        status = "Done";
    } else
    {
        // analyze the cause
        switch (event.getResult().getSeverity()) {
        case IStatus.CANCEL:
            status = "Cancelled";
            break;
        case IStatus.ERROR:
            status = "Error";
            break;
        default:
            status = "Unknown";
            break;
        }
    }
    TLCActivator.logDebug("Job '" + jobName + "' terminated with status: { " + status + " }");
}
项目:NEXCORE-UML-Modeler    文件:CommonReportAction.java   
public void done(IJobChangeEvent event) {

    if (Status.OK_STATUS.equals(event.getResult())) {
        Display.getDefault().asyncExec(new Runnable() {
            public void run() {
                createCompleteMessageDialog();
            }
        });

    } else {
        Display.getDefault().asyncExec(new Runnable() {
            public void run() {
                MessageDialog.openWarning(getShell(), 
                    UMLMessage.MESSAGE_DIALOG_TITLE, 
                    UMLMessage.MESSAGE_FAIL_DOCUMENT_CREATION);
            }
        });

    }
}
项目:gwt-eclipse-plugin    文件:CompositeArtifactsDowloadJobChangeListener.java   
private JobChangeAdapter getSiteDownloadJobChangeListener(
    final File tempFile, final UpdateSiteToken token) {

  return new JobChangeAdapter() {
    @Override
    public void done(IJobChangeEvent event) {
      IStatus result = event.getResult();
      if (result != null && result.isOK()) {
        Element rootElement = getRootElement(tempFile);
        if (rootElement != null) {
          List<UpdateInfo> updates =
              updateCheckersMap.get(token).checkForUpdates(rootElement);
          assert (updates != null);
          if (!updates.isEmpty()) {
            updateList.addAll(updates);
          }
        }
      }
      // Signal the parent on completion of the download.
      siteXmlDownloadJobsCountDownLatch.countDown();
    }
  };
}
项目:filesync4eclipse    文件:ProjectProperties.java   
private void initPreferencesStore() {
    IScopeContext projectScope = new ProjectScope(project);
    preferences = projectScope.getNode(FileSyncPlugin.PLUGIN_ID);
    buildPathMap(preferences);
    preferences.addPreferenceChangeListener(this);
    preferences.addNodeChangeListener(this);
    IStringVariableManager manager = VariablesPlugin.getDefault().getStringVariableManager();
    manager.addValueVariableListener(this);
    jobChangeAdapter = new JobChangeAdapter(){
        @Override
        public void done(IJobChangeEvent event) {
            // XXX dirty trick to re-evaluate dynamic egit variables on branch change
            if(!event.getJob().getClass().getName().contains("org.eclipse.egit.ui.internal.branch.BranchOperationUI")){
                return;
            }
            rebuildPathMap();
        }
    };
    Job.getJobManager().addJobChangeListener(jobChangeAdapter);
    ResourcesPlugin.getWorkspace().addResourceChangeListener(this);
}
项目:APICloud-Studio    文件:SVNTeamProviderType.java   
public synchronized static AutoShareJob getAutoShareJob() {
    if (autoShareJob == null) {
        autoShareJob = new AutoShareJob();
        autoShareJob.addJobChangeListener(new JobChangeAdapter() {
            public void done(IJobChangeEvent event) {
                // Reschedule the job if it has unprocessed projects
                if (!autoShareJob.isQueueEmpty()) {
                    autoShareJob.schedule();
                }
            }
        });
        autoShareJob.setSystem(true);
        autoShareJob.setPriority(Job.SHORT);
        // Must run with the workspace rule to ensure that projects added while we're running
        // can be shared
        autoShareJob.setRule(ResourcesPlugin.getWorkspace().getRoot());
    }
    return autoShareJob;
}
项目:APICloud-Studio    文件:AbstractJhlClientAdapter.java   
public void upgradeProject(final File path) {

    UpgradeJob job = new UpgradeJob("upgrade", path);

    job.setUser(true);
    job.schedule();
    job.getState();
    job.addJobChangeListener(new JobChangeAdapter() {
        public void done(IJobChangeEvent event) {
            if (event.getResult().isOK())
                Display.getDefault().asyncExec(new Runnable() {
                    public void run() {
                        MessageDialog.openInformation(null,
                                "upgrade is over", "SVN升级完毕,请重新操作!");
                    }
                });
        }
    });
}
项目:OpenSPIFe    文件:InPlaceCheckBoxTreeDialog.java   
@Override
protected WorkbenchJob doCreateRefreshJob() {
    WorkbenchJob job = super.doCreateRefreshJob();
    job.addJobChangeListener(new JobChangeAdapter() {
        @SuppressWarnings("deprecation")
        @Override
        public void done(IJobChangeEvent event) {
            if (event.getResult() != null && event.getResult().isOK() && !getViewer().getTree().isDisposed()) {
                Set<String> joinChecked = new HashSet(getSelectedValues());
                for(String i : getPartialValues()) {
                    getViewer().setGrayed(i, true);
                    joinChecked.add(i);
                }
                getViewer().setCheckedElements(joinChecked.toArray());
            }
        }
    });
    return job;
}
项目:OpenSPIFe    文件:TemplatePlanPage.java   
/**
 * When the TreeViewer is refreshed, the template plans are re-loaded. Do this in a Job.
 * @param viewer the TreeViewer being refreshed
 */
protected synchronized void loadTemplatePlans() {
    if (loadJobInProgress) {
        return;
    }
    final Job load = new TemplatePlanLoadingJob("Loading Template Plan", treeViewer);
    load.addJobChangeListener(new JobChangeAdapter() {
        /**
         * When the Job is done, if it was successful clear the Job's name.
         * @param event contains the Job's results, indicating whether successful
         */
        @Override
        public void done(IJobChangeEvent event) {
            loadJobInProgress = false;
            if (event.getResult().isOK())
                load.setName("");
        }
    });
    load.schedule();
    loadJobInProgress = true;
}
项目:IDE    文件:WbConfigurationEditor.java   
@Override
public void done(IJobChangeEvent event) {
    if (event.getJob().getName().equals("VagrantManager")) {
        Display.getDefault().syncExec(new Runnable() {
            public void run() {
                engine.getStatusModel().setVagrantRunning(true);
            }
        });
    } else if (event.getJob().getName().equals("SshManager")) {
        Display.getDefault().syncExec(new Runnable() {

            public void run() {
                engine.getStatusModel().setSshRunning(true);
            }

        });
    }

}
项目:ChangeScribe    文件:FilteredCheckboxTree.java   
protected WorkbenchJob doCreateRefreshJob() {
    WorkbenchJob filterJob = super.doCreateRefreshJob();
    filterJob.addJobChangeListener(new JobChangeAdapter() {
        public void done(IJobChangeEvent event) {
            if (event.getResult().isOK()) {
                getDisplay().asyncExec(new Runnable() {
                    public void run() {
                        if (checkboxViewer.getTree().isDisposed())
                            return;
                        checkboxViewer.restoreLeafCheckState();
                    }
                });
            }
        }
    });
    return filterJob;
}
项目:eclipse-i18ntools    文件:RefactoringJobCallbackPostProcessor.java   
@Override
public void done(IJobChangeEvent event) {
    for (IRefactoringJobCallback callback : RefactoringJobCallbacksManager.INSTANCE.getRegisteredCallbacks()) {
        try {
            if (callback != null) {
                callback.execute(this.impactedCompilationUnit);
            }
        } catch (Exception e) {
            Activator
                    .getDefault()
                    .getLog()
                    .log(new Status(IStatus.WARNING, Activator.PLUGIN_ID,
                            RefactoringWizardMessages.ERROR_EXECUTING_CALLBACK.value(), e));
        }
    }
}
项目:WkHtmlToPdf    文件:PdfScheduler.java   
public void submit(PdfRequest request) {

    // if There is no running job - Start it
    // Else add to the Queue

    synchronized (PdfScheduler.class) {
        if (runningJob == null) {
            runningJob = new PdfJob("PDF Something", request);
            runningJob.addJobChangeListener(new JobChangeAdapter() {
                public void done(IJobChangeEvent event) {
                    runningJob = null;
                }
            });
            AccessController.doPrivileged(new PrivilegedAction<Object>() {
                public Object run() {
                    runningJob.schedule();
                    return null;
                }
            });
        }
    }
}
项目:WkHtmlToPdf    文件:PdfScheduler.java   
public void start() {
    synchronized (PdfScheduler.class) {
        if (runningJob == null) {
            runningJob = new PdfJob("PDF Something", null);
            runningJob.addJobChangeListener(new JobChangeAdapter() {
                public void done(IJobChangeEvent event) {
                    runningJob = null;
                }
            });
            AccessController.doPrivileged(new PrivilegedAction<Object>() {
                public Object run() {
                    runningJob.schedule();
                    return null;
                }
            });
        }
    }
}
项目:WkHtmlToPdf    文件:JobScheduler.java   
public static void start() {
    synchronized (JobScheduler.class) {
        if (runningJob == null) {
            runningJob = new DemoJob("XPages Demo Database");
            runningJob.addJobChangeListener(new JobChangeAdapter() {
                public void done(IJobChangeEvent event) {
                    runningJob = null;
                }
            });
            AccessController.doPrivileged(new PrivilegedAction<Object>() {
                public Object run() {
                    runningJob.schedule();
                    return null;
                }
            });
        }
    }
}
项目:BuildXPages    文件:BuildJobChangeAdapter.java   
@Override
public void done(IJobChangeEvent event) {

    if (event.getResult().isOK())
        writer.println("BUILD JOB STATUS: SUCCESS");
    else {
        writer.println("BUILD JOB STATUS: FAIL");
        writer.println(event.getResult().getMessage() + event.getResult().getCode());
        if (event.getResult().getException() != null) {
            writer.println(event.getResult().getException().getMessage());
        }

    }

    super.done(event);
}
项目:DynamicSpotter    文件:JobsContainer.java   
/**
 * Convenience method to add running jobs that will be automatically
 * cancelled silently if the plug-in is shutting down and they are still
 * running.
 * 
 * @param jobId
 *            the job id of the job
 * @param job
 *            the job to add
 */
public static void addRunningJob(final long jobId, DynamicSpotterRunJob job) {
    // automatically remove the job when it's done
    job.addJobChangeListener(new JobChangeAdapter() {
        @Override
        public void done(IJobChangeEvent event) {
            synchronized (jobMonitor) {
                runningJobs.remove(jobId);
            }
        }
    });

    synchronized (jobMonitor) {
        runningJobs.put(jobId, job);
    }
}
项目:jkind-xtext    文件:RunJRealizabilityHandler.java   
private void activateTerminateHandler(final IProgressMonitor monitor, final WorkspaceJob job) {
    final IHandlerService handlerService = (IHandlerService) window
            .getService(IHandlerService.class);
    window.getShell().getDisplay().syncExec(new Runnable() {
        @Override
        public void run() {
            final IHandlerActivation activation = handlerService.activateHandler(TERMINATE_ID,
                    new TerminateHandler(monitor));
            job.addJobChangeListener(new JobChangeAdapter() {
                @Override
                public void done(IJobChangeEvent event) {
                    window.getShell().getDisplay().syncExec(new Runnable() {
                        @Override
                        public void run() {
                            handlerService.deactivateHandler(activation);
                        }
                    });
                }
            });
        }
    });
}
项目:jkind-xtext    文件:RunJKindHandler.java   
private void activateTerminateHandler(final IProgressMonitor monitor, final WorkspaceJob job) {
    final IHandlerService handlerService = (IHandlerService) window
            .getService(IHandlerService.class);
    window.getShell().getDisplay().syncExec(new Runnable() {
        @Override
        public void run() {
            final IHandlerActivation activation = handlerService.activateHandler(TERMINATE_ID,
                    new TerminateHandler(monitor));
            job.addJobChangeListener(new JobChangeAdapter() {
                @Override
                public void done(IJobChangeEvent event) {
                    window.getShell().getDisplay().syncExec(new Runnable() {
                        @Override
                        public void run() {
                            handlerService.deactivateHandler(activation);
                        }
                    });
                }
            });
        }
    });
}
项目:GrayTin    文件:UpdateWorkspaceToBuildRevision.java   
protected void updateWorkspaceProjectToRevisionOfTheBuild(final Build from, final Build to) {
    UpdateToBuildRevisionAllWorspaceProjectsJob updateJob = new UpdateToBuildRevisionAllWorspaceProjectsJob(from, to);
    updateJob.setUser(true);
    updateJob.schedule();
    updateJob.addJobChangeListener(new JobChangeAdapter() {
        @Override
        public void done(IJobChangeEvent ignore) {

            if (!SDKActivator.isSDKStyle()) {
                to.save();
                return;
            }

            Display.getDefault().asyncExec(new Runnable() {
                public void run() {
                    boolean nonSDK = MessageDialog.openQuestion(Display.getCurrent().getActiveShell(), "Do you work NON-SDK style?",
                            "Do you want to mark build (" + to + ") as current build. This option is handy when you work NON-SDK style, otherwise say no"); //$NON-NLS-1$
                    if (nonSDK) {
                        to.save();
                    }
                }
            });
            System.out.println("Revisions of workspace where updated to build: " + to);
        }
    });
}
项目:GrayTin    文件:DeleteBinaryDuplicates.java   
/**
 * the command has been executed, so extract extract the needed information from the application context.
 */
protected void doExecute(final ExecutionEvent executionEvent) {
    Job sdkUpdateJob = new DeleteSDKBundlesJob(JOB_NAME);
    sdkUpdateJob.setUser(true);
    sdkUpdateJob.schedule();
    sdkUpdateJob.addJobChangeListener(new JobChangeAdapter() {
        @Override
        public void done(final IJobChangeEvent event) {
            final IStatus resultStatus = event.getJob().getResult();
            Display.getDefault().asyncExec(new Runnable() {
                public void run() {
                    if (resultStatus.isOK()) {
                        MessageDialog.openInformation(Display.getCurrent().getActiveShell(), "Delete binary duplicates in SDK-BUNDLES folder",
                                resultStatus.getMessage());
                    } else {
                        MessageDialog.openError(Display.getCurrent().getActiveShell(), "Delete binary duplicates in SDK-BUNDLES folder",
                                resultStatus.getMessage());
                    }
                }
            });

        }
    });

}
项目:XPagesToolkit    文件:XPageAgentRegistry.java   
private void initExecutionBE(final XPageAgentEntry agentEntry, FacesContext fc) {
    try {
        final XPageAgentJob jbCurrent = buildAgentClass(agentEntry, fc);
        agentEntry.runScheduled();
        m_RunningJobs.put(jbCurrent.getJobID(), jbCurrent);
        jbCurrent.addJobChangeListener(new JobChangeAdapter() {
            @Override
            public void done(IJobChangeEvent event) {
                m_RunningJobs.remove(jbCurrent.getJobID());
                agentEntry.endSchedules();
            }
        });

        AccessController.doPrivileged(new PrivilegedAction<Object>() {

            @Override
            public Object run() {
                jbCurrent.schedule(1000);
                return null;
            }
        });
    } catch (Exception e) {
        m_Logger.log(Level.SEVERE, "Error during initExcecutionBE: ", e);
    }
}
项目:elexis-3-base    文件:AbstractChartComposite.java   
public void done(IJobChangeEvent event) {
    // allow other threads to update this UI thread
    // http://www.eclipse.org/swt/faq.php#uithread
    UiDesk.getDisplay().syncExec(new Runnable() {
        public void run() {
            AbstractChartComposite.this.clean();

            // check if the creator has an empty dataset
            if (AbstractChartComposite.this.creator.isDatasetEmpty()) {
                AbstractChartComposite.this.setEmptyMessage();
            } else {
                // displa the chart else
                AbstractChartComposite.this.chartComposite = new ChartComposite(AbstractChartComposite.this,
                        SWT.NONE, AbstractChartComposite.this.initializeChart());
                AbstractChartComposite.this.chartComposite.setLayoutData(AbstractChartComposite.this.layoutData);
            }

            AbstractChartComposite.this.layout();
        }
    });
}
项目:ide-plugins    文件:ExecuteUploadFunction.java   
public void execute() {
    BuildClass build = new BuildClass("GFBundle task");
    build.setUser(true);
    build.addJobChangeListener(new JobChangeAdapter() {
        @Override
        public void done(IJobChangeEvent event) {
            super.done(event);
            if (event.getResult().isOK()) {
                File resource = new File(project.getRawLocationURI().getPath().concat("/build/distributions/gfBundle.zip"));
                if (resource.exists()) {
                    Properties gradleProperties = getGradleProperties();
                    if (gradleProperties != null) {
                        try {
                            final String cloudLinkIdeKey = utils.getCloudLinkIdeKey();
                            UploadFunction.upload(cloudLinkIdeKey, gradleProperties.getProperty("gfName"),
                            gradleProperties.getProperty("gfEntrypoint"), resource);
                        } catch (IOException e) {
                            e.printStackTrace();
                        }
                    }
                }
            }
        }
    });

    build.schedule();
}
项目:neoscada    文件:FactoryEditor.java   
public void refresh ()
{
    final LoadFactoryJob job = this.factoryInput.createLoadJob ();
    job.addJobChangeListener ( new JobChangeAdapter () {
        @Override
        public void done ( final IJobChangeEvent event )
        {
            FactoryEditor.this.handleSetResult ( job.getFactory (), FactoryEditor.this.factoryInput.getConnectionUri () );
        }
    } );
    job.schedule ();
}
项目:neoscada    文件:FactoryEditor.java   
private void insertEntry ( final String value )
{
    final Job job = this.factoryInput.createCreateJob ( value );
    job.addJobChangeListener ( new JobChangeAdapter () {
        @Override
        public void done ( final IJobChangeEvent event )
        {
            refresh ();
        }
    } );
    job.schedule ();
}
项目:neoscada    文件:ConfigurationEditorInput.java   
public void performLoad ( final IProgressMonitor monitor )
{
    final LoadJob job = load ();
    job.addJobChangeListener ( new JobChangeAdapter () {
        @Override
        public void done ( final IJobChangeEvent event )
        {
            handleSetResult ( job.getConfiguration () );
        }
    } );
    job.setProgressGroup ( monitor, 2 );
    job.schedule ();
}
项目:pgcodekeeper    文件:ProjectEditorDiffer.java   
public void diff() {
    Log.log(Log.LOG_INFO, "Started DB update"); //$NON-NLS-1$
    if (warnCheckedElements() < 1 ||
            !OpenProjectUtils.checkVersionAndWarn(proj.getProject(), parent.getShell(), true)) {
        return;
    }

    IEclipsePreferences pref = proj.getPrefs();
    final Differ differ = new Differ(dbRemote.getDbObject(),
            dbProject.getDbObject(), diffTree.getRevertedCopy(), false,
            pref.get(PROJ_PREF.TIMEZONE, ApgdiffConsts.UTC));
    differ.setAdditionalDepciesSource(manualDepciesSource);
    differ.setAdditionalDepciesTarget(manualDepciesTarget);

    Job job = differ.getDifferJob();
    job.addJobChangeListener(new JobChangeAdapter() {

        @Override
        public void done(IJobChangeEvent event) {
            Log.log(Log.LOG_INFO, "Differ job finished with status " +  //$NON-NLS-1$
                    event.getResult().getSeverity());
            if (event.getResult().isOK()) {
                UiSync.exec(parent, () -> {
                    if (!parent.isDisposed()) {
                        try {
                            showEditor(differ);
                        } catch (PartInitException ex) {
                            ExceptionNotifier.notifyDefault(
                                    Messages.ProjectEditorDiffer_error_opening_script_editor, ex);
                        }
                    }
                });
            }
        }
    });
    job.setUser(true);
    job.schedule();
}
项目:termsuite-ui    文件:ProgressMonitorFocusJobDialog.java   
/**
 * Returns a listener that will close the dialog when the job completes.
 *
 * @return IJobChangeListener
 */
private IJobChangeListener createCloseListener() {
    return new JobChangeAdapter() {
        @Override
        public void done(IJobChangeEvent event) {
            // first of all, make sure this listener is removed
            event.getJob().removeJobChangeListener(this);
            if (!PlatformUI.isWorkbenchRunning()) {
                return;
            }
            // nothing to do if the dialog is already closed
            if (getShell() == null) {
                return;
            }
            Job closeJob = new UIJob(
                    ProgressMessages.ProgressMonitorFocusJobDialog_CLoseDialogJob) {
                @Override
                public IStatus runInUIThread(IProgressMonitor monitor) {
                    Shell currentShell = getShell();
                    if (currentShell == null || currentShell.isDisposed()) {
                        return Status.CANCEL_STATUS;
                    }
                    finishedRun();
                    return Status.OK_STATUS;
                }
            };
            closeJob.setSystem(true);
            closeJob.schedule();
        }
    };
}
项目:termsuite-ui    文件:NLPServiceImpl.java   
private void runPipelineOnCorpus(
        final EPipeline pipeline, 
        final Iterable<ESingleLanguageCorpus> corpusList, boolean useCache) {

    for(final ESingleLanguageCorpus corpus:corpusList) {
        Path preprocessedCorpusPath = getCachePath(corpus, pipeline.getTaggerConfigName(), pipeline.getMaxNumTermsMemory());

        if(useCache && preprocessedCorpusPath.toFile().isFile())
            runPipelineOnPreprocessedCorpus(pipeline, corpus, IndexedCorpusIO.fromJson(preprocessedCorpusPath));
        else {
            Job preprocessCorpusJob = getPrepareCorpusJob(pipeline, corpus);
            preprocessCorpusJob.addJobChangeListener(new JobChangeAdapter(){
                @Override
                public void done(IJobChangeEvent event) {
                    if(event.getResult().isOK()) {
                        runPipelineOnPreprocessedCorpus(
                                pipeline, 
                                corpus, 
                                IndexedCorpusIO.fromJson(preprocessedCorpusPath));
                    }
                    event.getJob().removeJobChangeListener(this);
                }
            });
            preprocessCorpusJob.schedule();
            eventBroker.post(TermSuiteEvents.JOB_STARTED, preprocessCorpusJob.getName());
        }
    }
}
项目:workspacemechanic    文件:MechanicService.java   
@Override
public void done(IJobChangeEvent event) {
  // This seems to double up a logged message with the job manager.
  if (!event.getResult().isOK()) {
    MechanicLog.getDefault().log(event.getResult());
  }
}
项目:team-explorer-everywhere    文件:TeamExplorerControl.java   
@Override
public void done(final IJobChangeEvent event) {
    final TeamExplorerNavigationItemConfig item =
        (TeamExplorerNavigationItemConfig) event.getJob().getProperty(NAVITEM_CONFIG_DATA_NAME);

    refreshView(item);
}
项目:google-cloud-eclipse    文件:DeployCommandHandler.java   
private void launchDeployJob(IProject project, Credential credential)
    throws IOException, CoreException {
  AnalyticsPingManager.getInstance().sendPing(AnalyticsEvents.APP_ENGINE_DEPLOY,
      analyticsDeployEventMetadataKey);

  IPath workDirectory = createWorkDirectory();
  DeployPreferences deployPreferences = getDeployPreferences(project);

  DeployConsole messageConsole =
      MessageConsoleUtilities.createConsole(getConsoleName(deployPreferences.getProjectId()),
                                            new DeployConsole.Factory());
  IConsoleManager consoleManager = ConsolePlugin.getDefault().getConsoleManager();
  consoleManager.showConsoleView(messageConsole);
  ConsoleColorProvider colorProvider = new ConsoleColorProvider();
  MessageConsoleStream outputStream = messageConsole.newMessageStream();
  MessageConsoleStream errorStream = messageConsole.newMessageStream();
  outputStream.setActivateOnWrite(true);
  errorStream.setActivateOnWrite(true);
  outputStream.setColor(colorProvider.getColor(IDebugUIConstants.ID_STANDARD_OUTPUT_STREAM));
  errorStream.setColor(colorProvider.getColor(IDebugUIConstants.ID_STANDARD_ERROR_STREAM));

  StagingDelegate stagingDelegate = getStagingDelegate(project);

  DeployJob deploy = new DeployJob(deployPreferences, credential, workDirectory,
      outputStream, errorStream, stagingDelegate);
  messageConsole.setJob(deploy);
  deploy.addJobChangeListener(new JobChangeAdapter() {

    @Override
    public void done(IJobChangeEvent event) {
      if (event.getResult().isOK()) {
        AnalyticsPingManager.getInstance().sendPing(AnalyticsEvents.APP_ENGINE_DEPLOY_SUCCESS,
            analyticsDeployEventMetadataKey);
      }
      launchCleanupJob();
    }
  });
  deploy.schedule();
}