本文整理匯總了Java中org.eclipse.core.runtime.jobs.JobChangeAdapter類的典型用法代碼示例。如果您正苦於以下問題:Java JobChangeAdapter類的具體用法?Java JobChangeAdapter怎麽用?Java JobChangeAdapter使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
JobChangeAdapter類屬於org.eclipse.core.runtime.jobs包,在下文中一共展示了JobChangeAdapter類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: runContainerResolverJob
import org.eclipse.core.runtime.jobs.JobChangeAdapter; //導入依賴的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.JobChangeAdapter; //導入依賴的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.JobChangeAdapter; //導入依賴的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: getAutoShareJob
import org.eclipse.core.runtime.jobs.JobChangeAdapter; //導入依賴的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;
}
示例5: setJob
import org.eclipse.core.runtime.jobs.JobChangeAdapter; //導入依賴的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()));
}
});
}
});
}
示例6: testIgnoreInnerPomChanges
import org.eclipse.core.runtime.jobs.JobChangeAdapter; //導入依賴的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);
}
}
示例7: getSiteDownloadJobChangeListener
import org.eclipse.core.runtime.jobs.JobChangeAdapter; //導入依賴的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
示例8: initPreferencesStore
import org.eclipse.core.runtime.jobs.JobChangeAdapter; //導入依賴的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);
}
示例9: upgradeProject
import org.eclipse.core.runtime.jobs.JobChangeAdapter; //導入依賴的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升級完畢,請重新操作!");
}
});
}
});
}
示例10: doCreateRefreshJob
import org.eclipse.core.runtime.jobs.JobChangeAdapter; //導入依賴的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;
}
示例11: loadTemplatePlans
import org.eclipse.core.runtime.jobs.JobChangeAdapter; //導入依賴的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;
}
示例12: doCreateRefreshJob
import org.eclipse.core.runtime.jobs.JobChangeAdapter; //導入依賴的package包/類
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;
}
示例13: submit
import org.eclipse.core.runtime.jobs.JobChangeAdapter; //導入依賴的package包/類
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;
}
});
}
}
}
示例14: start
import org.eclipse.core.runtime.jobs.JobChangeAdapter; //導入依賴的package包/類
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;
}
});
}
}
}
示例15: start
import org.eclipse.core.runtime.jobs.JobChangeAdapter; //導入依賴的package包/類
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;
}
});
}
}
}