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

项目: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();
      }
    }
  });
}
项目: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);
    }
}
项目: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;
}
项目: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;
}
项目: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;
                }
            });
        }
    }
}
项目: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);
    }
}
项目: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());
        }
    }
}
项目: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();
}
项目:google-cloud-eclipse    文件:DeployConsolePageParticipant.java   
private void addJobChangeListener() {
  DeployJob job = console.getJob();
  if (job != null) {
    job.addJobChangeListener(new JobChangeAdapter() {
      @Override
      public void done(IJobChangeEvent event) {
        update();
      }
    });
  }
}
项目:angular-eclipse    文件:AngularCLIConfigurationBlock.java   
public AngularCLIConfigurationBlock(IStatusChangeListener context, IProject project,
        IWorkbenchPreferenceContainer container) {
    super(context, project, getKeys(), container);
    ngVersionJob = new NgVersionJob();
    ngVersionJob.setNodeFile(getNodejsPath(project));
    ngVersionJob.addJobChangeListener(new JobChangeAdapter() {
        @Override
        public void done(IJobChangeEvent event) {
            IStatus status = event.getResult();
            if (!(status instanceof CLIStatus)) {
                return;
            }
            final CLIStatus s = (CLIStatus) status;
            Display.getDefault().asyncExec(new Runnable() {

                @Override
                public void run() {
                    if (cliVersion.isDisposed()) {
                        return;
                    }
                    if (!StringUtils.isEmpty(s.getVersion())) {
                        cliVersion.setText(s.getVersion());
                    } else {
                        cliPath.setText("");
                        cliVersion.setText("");

                    }
                    fContext.statusChanged(status);
                }
            });
        }
    });
    blockEnableState = null;
}
项目:yamcs-studio    文件:PreloadingRepositoryHandler.java   
void doExecuteAndLoad() {
    if (preloadRepositories()) {
        //cancel any load that is already running
        Job.getJobManager().cancel(LoadMetadataRepositoryJob.LOAD_FAMILY);
        final LoadMetadataRepositoryJob loadJob = new LoadMetadataRepositoryJob(getProvisioningUI());
        setLoadJobProperties(loadJob);
        if (waitForPreload()) {
            loadJob.addJobChangeListener(new JobChangeAdapter() {
                public void done(IJobChangeEvent event) {
                    if (PlatformUI.isWorkbenchRunning())
                        if (event.getResult().isOK()) {
                            PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
                                public void run() {
                                    doExecute(loadJob);
                                }
                            });
                        }
                }
            });
            loadJob.setUser(true);
            loadJob.schedule();

        } else {
            loadJob.setSystem(true);
            loadJob.setUser(false);
            loadJob.schedule();
            doExecute(null);
        }
    } else {
        doExecute(null);
    }
}
项目:datahierarchy    文件:ViewContentProvider.java   
@Override
public Job sheduleJob(final DelayedJavaElement<?, ? extends IJavaElement> searchRoot){
    Job job = new JavaSearchJob("Searching in " + searchRoot .getJavaElement().getElementName() + "...",
            searchRoot, this);
    job.setUser(true);
    job.addJobChangeListener(new JobChangeAdapter(){
        @Override
        public void done(IJobChangeEvent event) {
            ensureExpanded(searchRoot);
        }
    });
    getProgressService().schedule(job);
    return job;
}
项目:esdk_ide_ev3    文件:SocketInstance.java   
/**
 * 执行任务
 * @param runnable
 *            执行的任务
 */
public void execute(Job runnable)
{
    if (null != job)
    {
        MessageDialog.openWarning(Display.getDefault().getActiveShell(),
                "Warning", //$NON-NLS-1$
                "waiting last task to finished."); //$NON-NLS-1$
        Activator.getDefault()
                .getLog()
                .log(new Status(IStatus.WARNING, Activator.PLUGIN_ID,
                        "Result task is running.")); //$NON-NLS-1$
        return;
    }
    job = runnable;
    job.addJobChangeListener(new JobChangeAdapter()
    {
        /* (此注释不是Javadoc注释)
         * @see org.eclipse.core.runtime.jobs.JobChangeAdapter#done(org.eclipse.core.runtime.jobs.IJobChangeEvent)
         */
        @Override
        public void done(IJobChangeEvent event)
        {
            super.done(event);
            job = null;
        }
    });
    job.schedule();
}
项目:IDRT-Import-and-Mapping-Tool    文件:PreloadingRepositoryHandler.java   
void doExecuteAndLoad() {
    if (preloadRepositories()) {

        //cancel any load that is already running
        Job.getJobManager().cancel(LoadMetadataRepositoryJob.LOAD_FAMILY);
        final LoadMetadataRepositoryJob loadJob = new LoadMetadataRepositoryJob(getProvisioningUI());
        setLoadJobProperties(loadJob);
        if (waitForPreload()) {
            loadJob.addJobChangeListener(new JobChangeAdapter() {
                public void done(IJobChangeEvent event) {
                    if (PlatformUI.isWorkbenchRunning())
                        if (event.getResult().isOK()) {
                            PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
                                public void run() {
                                    doExecute(loadJob);
                                }
                            });
                        }
                }
            });
            loadJob.setUser(true);
            loadJob.schedule();

        } else {
            loadJob.setSystem(true);
            loadJob.setUser(false);
            loadJob.schedule();
            doExecute(null);
        }
    } else {
        doExecute(null);
    }
}
项目:eclipseforces    文件:DisabledWhileRunningJobAction.java   
public DisabledWhileRunningJobAction(String text, ImageDescriptor image, Job jobToRun) {
  super(text, image);

  this.jobToRun = jobToRun;

  jobToRun.addJobChangeListener(new JobChangeAdapter() {
    @Override
    public void done(IJobChangeEvent event) {
      synchronized (actionLock) {
        setEnabled(true);
      }
    }
  });

}
项目:APICloud-Studio    文件:ADBService.java   
public void syncLog() throws ADBException {
    if (!logListenning) {
        ScriptingConsole.getInstance().clear();
        ScriptLogger.logError("开启日志监听...");
        logListenning = true;
        Job startADBJob = new Job("Start ADB log") {
            protected IStatus run(IProgressMonitor monitor) {
                if (isStarted) {
                    try {
                        ADBCmdProcessor.callProcess(new ADBCommand(
                                ADBCommand.CMD_TYPE_LOGCAT));
                        logListenning = true;
                    } catch (ADBException e) {
                        e.printStackTrace();
                        logListenning = false;
                        //throw adbEx;
                    }
                }
                return Status.OK_STATUS;
            }
        };

        startADBJob.setSystem(true);
        startADBJob.schedule(500L);
        startADBJob.addJobChangeListener(new JobChangeAdapter() {
            public void done(IJobChangeEvent event) {
                if (event.getResult().isOK()) {
                    ScriptLogger.logError("\u65AD\u5F00\u8FDE\u63A5...");
                    logListenning = false;
                }
            }
        });

    }
}
项目:APICloud-Studio    文件:CheckLoaderDialog.java   
public void downloadBaseloader(final Shell shell, int id) {
    try {
        DownLoadJob downloadjob = new DownLoadJob(Messages.DOWNLOADOFFICIALLOADER, id);
        downloadjob.setUser(true);
        downloadjob.schedule();

        downloadjob.addJobChangeListener(new JobChangeAdapter() {
            public void done(IJobChangeEvent event) {
                if (event.getResult().isOK())
                    Display.getDefault().syncExec(new Runnable() {
                        public void run() {
                            MessageDialog.openInformation(null, Messages.DOWNLOADSUCCESS,
                                    Messages.LOADERDOWNLOADSUCC);
                        }
                    });
                else
                    Display.getDefault().syncExec(new Runnable() {
                        public void run() {
                            MessageDialog.openError(null, Messages.DOWNLOADEXCEPTION, Messages.DOWNLOADERROR);
                        }
                    });
                close();
            }
        });

        ResourcesPlugin.getWorkspace().build(
                IncrementalProjectBuilder.CLEAN_BUILD, null);
        ResourcesPlugin.getWorkspace().getRoot()
                .refreshLocal(IResource.DEPTH_INFINITE, null);
    com.apicloud.loader.platforms.android.ADBActivator.setHasBaseLoader(true);
    com.apicloud.loader.platforms.android.ADBActivator.setHasAppLoader(true);
    } catch (Exception e) {
        e.printStackTrace();
    }
}
项目:anatlyzer    文件:ExperimentConfigurationEditor.java   
void executeExperiment() {
    final ExperimentConfiguration conf = readConfigurationFile();

    loadExperiment(conf, (experiment, extension) -> {
        Job job = new ExperimentJob(conf, experiment, extension);
        job.schedule();
        job.addJobChangeListener(new JobChangeAdapter() {
            @Override
            public void done(IJobChangeEvent event) { 
                ExperimentConfigurationEditor.this.experiment = ((ExperimentJob) event.getJob()).experiment;
            }               
        });
        return true;
    });     
}