本文整理汇总了Java中org.eclipse.core.runtime.jobs.IJobChangeEvent类的典型用法代码示例。如果您正苦于以下问题:Java IJobChangeEvent类的具体用法?Java IJobChangeEvent怎么用?Java IJobChangeEvent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IJobChangeEvent类属于org.eclipse.core.runtime.jobs包,在下文中一共展示了IJobChangeEvent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: runContainerResolverJob
import org.eclipse.core.runtime.jobs.IJobChangeEvent; //导入依赖的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: performSave
import org.eclipse.core.runtime.jobs.IJobChangeEvent; //导入依赖的package包/类
@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 ();
}
示例3: ReattachProjectBundleSourcesJob
import org.eclipse.core.runtime.jobs.IJobChangeEvent; //导入依赖的package包/类
/**
* @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();
}
}
});
}
示例4: done
import org.eclipse.core.runtime.jobs.IJobChangeEvent; //导入依赖的package包/类
@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$
}
}
}
示例5: getAutoShareJob
import org.eclipse.core.runtime.jobs.IJobChangeEvent; //导入依赖的package包/类
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;
}
示例6: setJob
import org.eclipse.core.runtime.jobs.IJobChangeEvent; //导入依赖的package包/类
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()));
}
});
}
});
}
示例7: testIgnoreInnerPomChanges
import org.eclipse.core.runtime.jobs.IJobChangeEvent; //导入依赖的package包/类
@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);
}
}
示例8: done
import org.eclipse.core.runtime.jobs.IJobChangeEvent; //导入依赖的package包/类
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 + " }");
}
示例9: done
import org.eclipse.core.runtime.jobs.IJobChangeEvent; //导入依赖的package包/类
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);
}
});
}
}
示例10: getSiteDownloadJobChangeListener
import org.eclipse.core.runtime.jobs.IJobChangeEvent; //导入依赖的package包/类
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();
}
};
}
开发者ID:gwt-plugins,项目名称:gwt-eclipse-plugin,代码行数:24,代码来源:CompositeArtifactsDowloadJobChangeListener.java
示例11: initPreferencesStore
import org.eclipse.core.runtime.jobs.IJobChangeEvent; //导入依赖的package包/类
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);
}
示例12: upgradeProject
import org.eclipse.core.runtime.jobs.IJobChangeEvent; //导入依赖的package包/类
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升级完毕,请重新操作!");
}
});
}
});
}
示例13: doCreateRefreshJob
import org.eclipse.core.runtime.jobs.IJobChangeEvent; //导入依赖的package包/类
@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;
}
示例14: loadTemplatePlans
import org.eclipse.core.runtime.jobs.IJobChangeEvent; //导入依赖的package包/类
/**
* 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;
}
示例15: done
import org.eclipse.core.runtime.jobs.IJobChangeEvent; //导入依赖的package包/类
@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);
}
});
}
}