本文整理匯總了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);
}
});
}
}