當前位置: 首頁>>代碼示例>>Java>>正文


Java IJobChangeEvent類代碼示例

本文整理匯總了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();
}
 
開發者ID:GoogleCloudPlatform,項目名稱:google-cloud-eclipse,代碼行數:17,代碼來源:BuildPath.java

示例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 ();
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:19,代碼來源:ConfigurationEditorInput.java

示例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();
      }
    }
  });
}
 
開發者ID:fbricon,項目名稱:pde.source.lookup,代碼行數:21,代碼來源:ReattachProjectBundleSourcesJob.java

示例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$
        }
    }
}
 
開發者ID:Microsoft,項目名稱:team-explorer-everywhere,代碼行數:20,代碼來源:ProjectConnectionManager.java

示例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;
}
 
開發者ID:subclipse,項目名稱:subclipse,代碼行數:20,代碼來源:SVNTeamProviderType.java

示例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()));
        }
      });
    }
  });
}
 
開發者ID:GoogleCloudPlatform,項目名稱:google-cloud-eclipse,代碼行數:17,代碼來源:DeployConsole.java

示例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);
	}
}
 
開發者ID:eclipse,項目名稱:eclipse.jdt.ls,代碼行數:27,代碼來源:MavenBuildSupportTest.java

示例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 + " }");
}
 
開發者ID:tlaplus,項目名稱:tlaplus,代碼行數:25,代碼來源:TLCModelLaunchDelegate.java

示例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);
            }
        });
        
    }
}
 
開發者ID:SK-HOLDINGS-CC,項目名稱:NEXCORE-UML-Modeler,代碼行數:21,代碼來源:CommonReportAction.java

示例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);
}
 
開發者ID:iloveeclipse,項目名稱:filesync4eclipse,代碼行數:22,代碼來源:ProjectProperties.java

示例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升級完畢,請重新操作!");
					}
				});
		}
	});
}
 
開發者ID:apicloudcom,項目名稱:APICloud-Studio,代碼行數:20,代碼來源:AbstractJhlClientAdapter.java

示例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;
}
 
開發者ID:nasa,項目名稱:OpenSPIFe,代碼行數:20,代碼來源:InPlaceCheckBoxTreeDialog.java

示例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;
}
 
開發者ID:nasa,項目名稱:OpenSPIFe,代碼行數:25,代碼來源:TemplatePlanPage.java

示例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);
			}

		});
	}

}
 
開發者ID:fp7-netide,項目名稱:IDE,代碼行數:20,代碼來源:WbConfigurationEditor.java


注:本文中的org.eclipse.core.runtime.jobs.IJobChangeEvent類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。