本文整理汇总了Java中org.eclipse.core.runtime.jobs.Job.addJobChangeListener方法的典型用法代码示例。如果您正苦于以下问题:Java Job.addJobChangeListener方法的具体用法?Java Job.addJobChangeListener怎么用?Java Job.addJobChangeListener使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.core.runtime.jobs.Job
的用法示例。
在下文中一共展示了Job.addJobChangeListener方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: runContainerResolverJob
import org.eclipse.core.runtime.jobs.Job; //导入方法依赖的package包/类
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();
}
示例2: insertEntry
import org.eclipse.core.runtime.jobs.Job; //导入方法依赖的package包/类
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 ();
}
示例3: diff
import org.eclipse.core.runtime.jobs.Job; //导入方法依赖的package包/类
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();
}
示例4: runPipelineOnCorpus
import org.eclipse.core.runtime.jobs.Job; //导入方法依赖的package包/类
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());
}
}
}
示例5: commit
import org.eclipse.core.runtime.jobs.Job; //导入方法依赖的package包/类
public void commit() throws PgCodekeeperException {
Log.log(Log.LOG_INFO, "Started project update"); //$NON-NLS-1$
if (warnCheckedElements() < 1 ||
!OpenProjectUtils.checkVersionAndWarn(proj.getProject(), parent.getShell(), true)) {
return;
}
boolean considerDepcy = mainPrefs.getBoolean(COMMIT_PREF.CONSIDER_DEPCY_IN_COMMIT);
Set<TreeElement> sumNewAndDelete = null;
if(considerDepcy){
Log.log(Log.LOG_INFO, "Processing depcies for project update"); //$NON-NLS-1$
sumNewAndDelete = new DepcyTreeExtender(dbProject.getDbObject(),
dbRemote.getDbObject(), diffTree).getDepcies();
}
Log.log(Log.LOG_INFO, "Querying user for project update"); //$NON-NLS-1$
// display commit dialog
CommitDialog cd = new CommitDialog(parent.getShell(), sumNewAndDelete, dbProject, dbRemote,
diffTree, mainPrefs, isCommitCommandAvailable);
if (cd.open() != CommitDialog.OK) {
return;
}
Log.log(Log.LOG_INFO, "Updating project " + proj.getProjectName()); //$NON-NLS-1$
Job job = new JobProjectUpdater(Messages.projectEditorDiffer_save_project, diffTree);
job.addJobChangeListener(new JobChangeAdapter() {
@Override
public void done(IJobChangeEvent event) {
Log.log(Log.LOG_INFO, "Project updater job finished with status " + //$NON-NLS-1$
event.getResult().getSeverity());
if (event.getResult().isOK()) {
ConsoleFactory.write(Messages.commitPartDescr_success_project_updated);
try {
proj.getProject().refreshLocal(IResource.DEPTH_INFINITE, null);
UiSync.exec(parent, new Runnable() {
@Override
public void run() {
if (!parent.isDisposed()) {
callEgitCommitCommand();
}
}
});
} catch (CoreException e) {
ExceptionNotifier.notifyDefault(Messages.ProjectEditorDiffer_error_refreshing_project, e);
}
}
}
});
job.setUser(true);
job.schedule();
}
示例6: execute
import org.eclipse.core.runtime.jobs.Job; //导入方法依赖的package包/类
@Execute
public void execute(
@Optional @Named(IServiceConstants.ACTIVE_SHELL) Shell shell,
@Optional TerminologyService terminologyService,
@Optional ETerminologyService eTerminologyService,
ILoggerProvider loggerProvider,
UISynchronize sync,
@Optional ETerminology terminology,
IEventBroker broker,
@Optional IndexedCorpus indexedCorpus
) throws IOException {
FilterTerminologyDialog filterDialog = new FilterTerminologyDialog(shell);
if(filterDialog.open() == Dialog.OK){
Job job = Job.create("Filtering terminology " + TerminologyPart.toPartLabel(terminology), (monitor) -> {
new TerminologyFilterer(filterDialog.getFilterOptions()).filter(indexedCorpus);
});
job.addJobChangeListener(new JobChangeAdapter(){
@Override
public void done(IJobChangeEvent event) {
if(event.getResult().getSeverity() == Status.OK) {
try {
eTerminologyService.saveTerminologyJson(terminology, indexedCorpus, true, true);
broker.post(TermSuiteEvents.TERMINOLOGY_MODIFIED, terminology);
eTerminologyService.invalidateCaches(terminology);
} catch (IOException e) {
String message = "Failed to save terminology " + TerminologyPart.toPartLabel(terminology);
loggerProvider.getClassLogger(getClass()).error(e, message);
sync.asyncExec(() -> MessageDialog.openError(shell, "Error saving terminology: " + e.getMessage(), message));
}
}
super.done(event);
event.getJob().removeJobChangeListener(this);
}
});
job.schedule();
}
}
示例7: TurnusProcess
import org.eclipse.core.runtime.jobs.Job; //导入方法依赖的package包/类
/**
* Create a new process
*
* @param name
* the process name
* @param job
* the attached job
* @param launch
* the launcher
*/
public TurnusProcess(String name, Job job, ILaunch launch) {
this.launch = launch;
this.job = job;
this.label = "[TURNUS virtual process] (" + name + ")";
terminated = false;
streamProxy = new TurnusProxy();
job.addJobChangeListener(new TurnusJobAdapter(this));
}