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


Java IProgressMonitor.worked方法代碼示例

本文整理匯總了Java中org.eclipse.core.runtime.IProgressMonitor.worked方法的典型用法代碼示例。如果您正苦於以下問題:Java IProgressMonitor.worked方法的具體用法?Java IProgressMonitor.worked怎麽用?Java IProgressMonitor.worked使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.eclipse.core.runtime.IProgressMonitor的用法示例。


在下文中一共展示了IProgressMonitor.worked方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: performFinish

import org.eclipse.core.runtime.IProgressMonitor; //導入方法依賴的package包/類
public boolean performFinish() {
	final Collection<ProjectDescriptor> projectDescriptors = getProjectDescriptors();
	
	WorkspaceJob job = new WorkspaceJob("Unzipping Projects") {
		@Override
		public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException {
			monitor.beginTask("Unzipping Projects", projectDescriptors.size());
			//System.out.println("Unzipping projects...");
			for ( ProjectDescriptor desc : projectDescriptors ) {
				unzipProject(desc, monitor);
				monitor.worked(1);
			}
			//System.out.println("Projects unzipped");
			return Status.OK_STATUS;
		}
	};
	job.setRule(ResourcesPlugin.getWorkspace().getRoot());
	job.schedule();
	return true;
}
 
開發者ID:eclipse,項目名稱:gemoc-studio,代碼行數:21,代碼來源:AbstractExampleWizard.java

示例2: setComparison

import org.eclipse.core.runtime.IProgressMonitor; //導入方法依賴的package包/類
/**
 * Show the given comparison in the widget. All arguments may be <code>null</code>.
 *
 * @param comparison
 *            the comparison to show in the widget or <code>null</code> to clear the widget.
 * @param focusImplId
 *            the ID of a single implementation to focus on (all other implementations will be hidden; columns of
 *            index 2 and above will show additional information for this focus implementation) or <code>null</code>
 *            to show all available implementations side-by-side (but without additional information in separate
 *            columns).
 * @param monitor
 *            the progress monitor to use or <code>null</code>.
 */
public void setComparison(ProjectComparison comparison, String focusImplId, IProgressMonitor monitor) {
	this.comparison = comparison;
	this.focusImplIndex = comparison != null && focusImplId != null ? comparison.getImplIndex(focusImplId) : -1;
	this.cachedDocumentation = null;

	// in case of a focus implementation, read documentation for API and the focus implementation into cache
	if (comparison != null && focusImplId != null) {
		if (monitor != null) {
			monitor.subTask("Scanning jsdoc ...");
			monitor.worked(1);
		}
		final int focusImplIdx = comparison.getImplIndex(focusImplId);
		cachedDocumentation = projectCompareTreeHelper.readDocumentation(comparison, new int[] { focusImplIdx });
	}

	if (monitor != null) {
		monitor.subTask("Updating UI ...");
		monitor.worked(1);
	}
	setInput(comparison);
	refreshColumnHeaders();
	expandAll();
}
 
開發者ID:eclipse,項目名稱:n4js,代碼行數:37,代碼來源:ProjectCompareTree.java

示例3: installUninstallNPMs

import org.eclipse.core.runtime.IProgressMonitor; //導入方法依賴的package包/類
private void installUninstallNPMs(final Map<String, String> versionedNPMs, final IProgressMonitor monitor,
		final MultiStatus status, final Set<String> requestedNPMs, final Set<String> oldNPMs) {

	logger.logInfo(LINE_SINGLE);
	logger.logInfo("Installing packages... [step 1 of 4]");
	monitor.setTaskName("Installing packages... [step 1 of 4]");
	// calculate already installed to skip
	final Set<String> npmNamesToInstall = difference(requestedNPMs, oldNPMs);
	final Set<String> npmsToInstall = versionedNPMs.entrySet().stream()
			// skip already installed
			.filter(e -> npmNamesToInstall.contains(e.getKey()))
			// [name, @">=1.0.0 <2.0.0"] to [[email protected]">=1.0.0 <2.0.0"]
			.map(e -> e.getKey() + Strings.emptyIfNull(e.getValue()))
			.collect(Collectors.toSet());

	IStatus installStatus = batchInstallUninstall(monitor, npmsToInstall, true);

	// log possible errors, but proceed with the process
	// assume that at least some packages were installed correctly and can be adapted
	if (!installStatus.isOK()) {
		logger.logInfo("Some packages could not be installed due to errors, see log for details.");
		status.merge(installStatus);
	}
	monitor.worked(2);
}
 
開發者ID:eclipse,項目名稱:n4js,代碼行數:26,代碼來源:NpmManager.java

示例4: adaptNPMPackages

import org.eclipse.core.runtime.IProgressMonitor; //導入方法依賴的package包/類
private Collection<File> adaptNPMPackages(final IProgressMonitor monitor, final MultiStatus status,
		final Collection<String> addedDependencies) {

	logger.logInfo(LINE_SINGLE);
	logger.logInfo("Adapting npm package structure to N4JS project structure... [step 3 of 4]");
	monitor.setTaskName("Adapting npm package structure to N4JS project structure... [step 3 of 4]");
	final Pair<IStatus, Collection<File>> result = npmPackageToProjectAdapter.adaptPackages(addedDependencies);
	final IStatus adaptionStatus = result.getFirst();

	// log possible errors, but proceed with the process
	// assume that at least some packages were installed correctly and can be adapted
	if (!adaptionStatus.isOK()) {
		logger.logError(adaptionStatus);
		status.merge(adaptionStatus);
	}

	final Collection<File> adaptedPackages = result.getSecond();
	logger.logInfo("Packages structures has been adapted to N4JS project structure.");
	monitor.worked(2);

	logger.logInfo(LINE_SINGLE);
	return adaptedPackages;
}
 
開發者ID:eclipse,項目名稱:n4js,代碼行數:24,代碼來源:NpmManager.java

示例5: doFinish

import org.eclipse.core.runtime.IProgressMonitor; //導入方法依賴的package包/類
private void doFinish(IPath containerPath, String[] path, IProgressMonitor monitor) throws CoreException {
	monitor.beginTask("Creating package " + String.join(".", path), path.length);
	IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();

	IResource resource = root.findMember(containerPath);
	if (!resource.exists() || !(resource instanceof IContainer)) {
		throwCoreException("Container \"" + containerPath + "\" does not exist.");
	}

	IContainer container = (IContainer) resource;
	for(int i = 0; i < path.length; i++) {
		Path p = new Path(path[i]);
		final IFolder folder = container.getFolder(p);
		if(!folder.exists())
			folder.create(true, false, monitor);
		container = container.getFolder(p);
		monitor.worked(1);
	}
}
 
開發者ID:andre-santos-pt,項目名稱:pandionj,代碼行數:20,代碼來源:NewPackageWizard.java

示例6: automate

import org.eclipse.core.runtime.IProgressMonitor; //導入方法依賴的package包/類
private void automate(IProgressMonitor monitor) throws TraceException {
  final List<EObject> allEObjects = new ArrayList<>();
  for (LoadItem load : TraceManager.get().getLoads()) {
    if (load.getInstanceRoot() == null) {
      throw new TraceException("Check alias: " + load.getAlias()
          + "\nYou must define the ecore instance location to create the traces.\n"
          + "\n e.g. -- [email protected]/path/to/your.xmi");
    }
    findAllEObjects(allEObjects, load.getInstanceRoot());
    allEObjects.remove(load.getInstanceRoot());
  }
  monitor.worked(1);
  createMarkers(allEObjects);
  monitor.worked(2);
  createRelations();
  monitor.worked(2);
}
 
開發者ID:ModelWriter,項目名稱:Tarski,代碼行數:18,代碼來源:AutomatedTraceCreator.java

示例7: doGenerateClassifier

import org.eclipse.core.runtime.IProgressMonitor; //導入方法依賴的package包/類
/**
 * Performs the actual generation of {@link #performFinish()} call.
 *
 * @throw {@link WorkspaceWizardGeneratorException} in case of any problem during the generation process. The
 *        message of these exceptions is reported on the UI.
 *
 */
protected void doGenerateClassifier(IProgressMonitor monitor)
		throws WorkspaceWizardGeneratorException {
	monitor = SubMonitor.convert(monitor, 2);

	WorkspaceWizardGenerator<M> generator = getGenerator();

	generator.performManifestChanges(getModel(), monitor);
	monitor.worked(1);

	generator.writeToFile(getModel(), monitor);
	monitor.worked(1);
}
 
開發者ID:eclipse,項目名稱:n4js,代碼行數:20,代碼來源:N4JSNewClassifierWizard.java

示例8: doGenerate

import org.eclipse.core.runtime.IProgressMonitor; //導入方法依賴的package包/類
/**
 * Launches the generation.
 *
 * @param monitor
 *            This will be used to display progress information to the user.
 * @throws IOException
 *             Thrown when the output cannot be saved.
 * @generated
 */
public void doGenerate(IProgressMonitor monitor) throws IOException {
	if (!targetFolder.getLocation().toFile().exists()) {
		targetFolder.getLocation().toFile().mkdirs();
	}
	
	monitor.subTask("Loading...");
	org.eclipse.cmf.occi.core.gen.uris.main.Generate gen0 = new org.eclipse.cmf.occi.core.gen.uris.main.Generate(modelURI, targetFolder.getLocation().toFile(), arguments);
	monitor.worked(1);
	String generationID = org.eclipse.acceleo.engine.utils.AcceleoLaunchingUtil.computeUIProjectID("org.eclipse.cmf.occi.core.gen.uris", "org.eclipse.cmf.occi.core.gen.uris.main.Generate", modelURI.toString(), targetFolder.getFullPath().toString(), new ArrayList<String>());
	gen0.setGenerationID(generationID);
	gen0.doGenerate(BasicMonitor.toMonitor(monitor));
		
	
}
 
開發者ID:occiware,項目名稱:OCCI-Studio,代碼行數:24,代碼來源:GenerateAll.java

示例9: getChangedDependencies

import org.eclipse.core.runtime.IProgressMonitor; //導入方法依賴的package包/類
private Pair<Collection<String>, Iterable<java.net.URI>> getChangedDependencies(final IProgressMonitor monitor,
		Set<String> oldNPMs) {

	logger.logInfo(LINE_SINGLE);
	logger.logInfo("Calculating dependency changes... [step 2 of 4]");
	monitor.setTaskName("Calculating dependency changes... [step 2 of 4]");

	externalLibraryWorkspace.updateState();
	URI targetPlatformNodeModulesLocation = locationProvider.getTargetPlatformNodeModulesLocation();

	Map<String, String> afterDependencies = locationProvider.getTargetPlatformContent().dependencies;
	if (null == afterDependencies) {
		afterDependencies = newHashMap();
	}
	final Set<String> newDependencies = new HashSet<>(afterDependencies.keySet());

	Set<String> newNpmProjectNames = new HashSet<>();
	Iterable<IProject> newNPMs = externalLibraryWorkspace.getProjects(targetPlatformNodeModulesLocation);
	for (IProject newNPM : newNPMs) {
		newNpmProjectNames.add(newNPM.getName());
	}

	Set<String> overwrittenShippedLibNames = getOverwrittenShippedLibs(newNpmProjectNames);
	newDependencies.addAll(overwrittenShippedLibNames);

	final Collection<String> addedDependencies = difference(newDependencies, oldNPMs);
	final Collection<String> deletedDependencies = difference(oldNPMs, newDependencies);
	final File nodeModulesFolder = new File(targetPlatformNodeModulesLocation);
	final Iterable<java.net.URI> toBeDeleted = from(deletedDependencies)
			.transform(name -> new File(nodeModulesFolder, name).toURI());
	monitor.worked(1);
	logger.logInfo("Dependency changes have been successfully calculated.");

	Pair<Collection<String>, Iterable<java.net.URI>> changedDeps = Tuples.pair(addedDependencies, toBeDeleted);

	return changedDeps;
}
 
開發者ID:eclipse,項目名稱:n4js,代碼行數:38,代碼來源:NpmManager.java

示例10: doGenerate

import org.eclipse.core.runtime.IProgressMonitor; //導入方法依賴的package包/類
/**
 * Launches the generation.
 *
 * @param monitor
 *            This will be used to display progress information to the user.
 * @throws IOException
 *             Thrown when the output cannot be saved.
 * @generated
 */
public void doGenerate(IProgressMonitor monitor) throws IOException {
	if (!targetFolder.getLocation().toFile().exists()) {
		targetFolder.getLocation().toFile().mkdirs();
	}
	
	monitor.subTask("Loading...");
	org.eclipse.cmf.occi.core.gen.textile.main.Generate gen0 = new org.eclipse.cmf.occi.core.gen.textile.main.Generate(modelURI, targetFolder.getLocation().toFile(), arguments);
	monitor.worked(1);
	String generationID = org.eclipse.acceleo.engine.utils.AcceleoLaunchingUtil.computeUIProjectID("org.eclipse.cmf.occi.core.gen.textile", "org.eclipse.cmf.occi.core.gen.textile.main.Generate", modelURI.toString(), targetFolder.getFullPath().toString(), new ArrayList<String>());
	gen0.setGenerationID(generationID);
	gen0.doGenerate(BasicMonitor.toMonitor(monitor));
		
	
}
 
開發者ID:occiware,項目名稱:OCCI-Studio,代碼行數:24,代碼來源:GenerateAll.java

示例11: doFinish

import org.eclipse.core.runtime.IProgressMonitor; //導入方法依賴的package包/類
private void doFinish ( final IProgressMonitor monitor, final Item item, final Variant value ) throws Exception
{
    monitor.beginTask ( "Writing value to item", 2 );

    monitor.worked ( 1 );

    try
    {

        final DataItemHolder itemHolder = new DataItemHolder ( Activator.getDefault ().getBundle ().getBundleContext (), item, null );
        if ( !itemHolder.waitForConnection ( 5 * 1000 ) )
        {
            handleError ( new RuntimeException ( "No available connection" ).fillInStackTrace () );
            return;
        }

        final NotifyFuture<WriteResult> future = itemHolder.startWrite ( value, null, new DisplayCallbackHandler ( getShell (), "Write operation", "Write operation" ) );

        try
        {
            future.get ();
        }
        catch ( final Throwable e )
        {
            handleError ( e );
        }

    }
    finally
    {
        monitor.done ();
    }
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:34,代碼來源:WriteOperationWizard.java

示例12: doGenerate

import org.eclipse.core.runtime.IProgressMonitor; //導入方法依賴的package包/類
/**
 * Launches the generation.
 *
 * @param monitor
 *            This will be used to display progress information to the user.
 * @throws IOException
 *             Thrown when the output cannot be saved.
 * @generated
 */
public void doGenerate(IProgressMonitor monitor) throws IOException {
	if (!targetFolder.getLocation().toFile().exists()) {
		targetFolder.getLocation().toFile().mkdirs();
	}
	
	monitor.subTask("Loading...");
	org.eclipse.cmf.occi.core.gen.xml.main.Generate gen0 = new org.eclipse.cmf.occi.core.gen.xml.main.Generate(modelURI, targetFolder.getLocation().toFile(), arguments);
	monitor.worked(1);
	String generationID = org.eclipse.acceleo.engine.utils.AcceleoLaunchingUtil.computeUIProjectID("org.eclipse.cmf.occi.core.gen.xml", "org.eclipse.cmf.occi.core.gen.xml.main.Generate", modelURI.toString(), targetFolder.getFullPath().toString(), new ArrayList<String>());
	gen0.setGenerationID(generationID);
	gen0.doGenerate(BasicMonitor.toMonitor(monitor));
		
	
}
 
開發者ID:occiware,項目名稱:OCCI-Studio,代碼行數:24,代碼來源:GenerateAll.java

示例13: fillContentProvider

import org.eclipse.core.runtime.IProgressMonitor; //導入方法依賴的package包/類
@Override
protected void fillContentProvider(AbstractContentProvider contentProvider, ItemsFilter itemsFilter, IProgressMonitor progressMonitor) throws CoreException {
	      progressMonitor.beginTask("Searching", paths.size());
	      for (Iterator<VFUnit> iter = paths.iterator(); iter.hasNext();) {
	         contentProvider.add(((VFUnit)iter.next()), itemsFilter);
	         progressMonitor.worked(1);
	      }
	      progressMonitor.done();
}
 
開發者ID:VisuFlow,項目名稱:visuflow-plugin,代碼行數:10,代碼來源:ReturnPathFilter.java

示例14: doGenerate

import org.eclipse.core.runtime.IProgressMonitor; //導入方法依賴的package包/類
/**
 * Launches the generation.
 *
 * @param monitor
 *            This will be used to display progress information to the user.
 * @throws IOException
 *             Thrown when the output cannot be saved.
 * @generated
 */
public void doGenerate(IProgressMonitor monitor) throws IOException {
	if (!targetFolder.getLocation().toFile().exists()) {
		targetFolder.getLocation().toFile().mkdirs();
	}

	monitor.subTask("Loading...");
	org.eclipse.cmf.occi.core.gen.connector.main.Main gen0 = new org.eclipse.cmf.occi.core.gen.connector.main.Main(modelURI, targetFolder.getLocation().toFile(), arguments);
	monitor.worked(1);
	String generationID = org.eclipse.acceleo.engine.utils.AcceleoLaunchingUtil.computeUIProjectID("org.eclipse.cmf.occi.core.gen.connector", "org.eclipse.cmf.occi.core.gen.connector.main.Main", modelURI.toString(), targetFolder.getFullPath().toString(), new ArrayList<String>());
	gen0.setGenerationID(generationID);
	gen0.doGenerate(BasicMonitor.toMonitor(monitor));
}
 
開發者ID:occiware,項目名稱:OCCI-Studio,代碼行數:22,代碼來源:GenerateAll.java

示例15: doGenerate

import org.eclipse.core.runtime.IProgressMonitor; //導入方法依賴的package包/類
/**
 * Launches the generation.
 *
 * @param monitor
 *            This will be used to display progress information to the user.
 * @throws IOException
 *             Thrown when the output cannot be saved.
 * @generated
 */
public void doGenerate(IProgressMonitor monitor) throws IOException {
	if (!targetFolder.getLocation().toFile().exists()) {
		targetFolder.getLocation().toFile().mkdirs();
	}
	
	monitor.subTask("Loading...");
	org.eclipse.cmf.occi.core.gen.latex.main.Generate gen0 = new org.eclipse.cmf.occi.core.gen.latex.main.Generate(modelURI, targetFolder.getLocation().toFile(), arguments);
	monitor.worked(1);
	String generationID = org.eclipse.acceleo.engine.utils.AcceleoLaunchingUtil.computeUIProjectID("org.eclipse.cmf.occi.core.gen.latex", "org.eclipse.cmf.occi.core.gen.latex.main.Generate", modelURI.toString(), targetFolder.getFullPath().toString(), new ArrayList<String>());
	gen0.setGenerationID(generationID);
	gen0.doGenerate(BasicMonitor.toMonitor(monitor));
		
	
}
 
開發者ID:occiware,項目名稱:OCCI-Studio,代碼行數:24,代碼來源:GenerateAll.java


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