当前位置: 首页>>代码示例>>Java>>正文


Java IProgressMonitor.done方法代码示例

本文整理汇总了Java中org.eclipse.core.runtime.IProgressMonitor.done方法的典型用法代码示例。如果您正苦于以下问题:Java IProgressMonitor.done方法的具体用法?Java IProgressMonitor.done怎么用?Java IProgressMonitor.done使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.core.runtime.IProgressMonitor的用法示例。


在下文中一共展示了IProgressMonitor.done方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: fillContentProvider

import org.eclipse.core.runtime.IProgressMonitor; //导入方法依赖的package包/类
@Override
protected void fillContentProvider(final AbstractContentProvider contentProvider, final ItemsFilter itemsFilter,
		final IProgressMonitor monitor) throws CoreException {

	monitor.beginTask("Searching for N4JS types...", UNKNOWN);

	final Iterable<IEObjectDescription> types = filter(indexSupplier.get().getExportedObjects(),
			desc -> searchKind.matches(desc.getEClass()));

	monitor.beginTask("Searching for N4JS types...", size(types));
	types.forEach(desc -> {
		contentProvider.add(desc, itemsFilter);
		monitor.worked(1);
	});

	monitor.done();
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:18,代码来源:OpenTypeSelectionDialog.java

示例2: process

import org.eclipse.core.runtime.IProgressMonitor; //导入方法依赖的package包/类
public void process ( final IProgressMonitor monitor )
{
    try
    {
        new TypeWalker<> ( AlarmsEventsModule.class ).walk ( this.app, new TypeVisitor<AlarmsEventsModule> () {

            @Override
            public void visit ( final AlarmsEventsModule item ) throws Exception
            {
                process ( item );
            }
        } );
    }
    catch ( final Exception e )
    {
        throw new RuntimeException ( e );
    }
    finally
    {
        monitor.done ();
    }
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:23,代码来源:AlarmsEventsModuleProcessor.java

示例3: performFinish

import org.eclipse.core.runtime.IProgressMonitor; //导入方法依赖的package包/类
/**
 * Implements the interface method by looping through template sections and
 * executing them sequentially.
 * 
 * @param project
 *            the project
 * @param monitor
 *            the progress monitor to track the execution progress as part
 *            of the overall new project creation operation
 * @return <code>true</code> if the wizard completed the operation with
 *         success, <code>false</code> otherwise.
 */
public boolean performFinish(IProject project,  IProgressMonitor monitor) {
	try {
		ITemplateSection[] sections = getTemplateSections();
		monitor.beginTask("", sections.length); //$NON-NLS-1$
		for (int i = 0; i < sections.length; i++) {
			sections[i].execute(project,  new SubProgressMonitor(monitor, 1));
		}
		//No reason to do this any more with the new editors
		//saveTemplateFile(project, null);
	} catch (CoreException e) {
		PDEPlugin.logException(e);
		return false;
	} finally {
		monitor.done();
	}
	return true;
}
 
开发者ID:eclipse,项目名称:gemoc-studio,代码行数:30,代码来源:AbstractNewProjectTemplateWizard.java

示例4: processFile

import org.eclipse.core.runtime.IProgressMonitor; //导入方法依赖的package包/类
public static void processFile ( final IContainer parent, final Definition definition, final Profile profile, final IProgressMonitor monitor ) throws Exception
{
    monitor.beginTask ( makeJobLabel ( definition, profile ), 100 );

    final IFolder output = parent.getFolder ( new Path ( "output" ) ); //$NON-NLS-1$
    if ( output.exists () )
    {
        output.delete ( true, new SubProgressMonitor ( monitor, 9 ) );
    }
    output.create ( true, true, new SubProgressMonitor ( monitor, 1 ) );

    final Builder builder = new Builder ( definition, profile );
    final Recipe recipe = builder.build ();

    try
    {
        final Map<String, Object> initialContent = new HashMap<String, Object> ();
        initialContent.put ( "output", output ); //$NON-NLS-1$

        recipe.execute ( initialContent, new SubProgressMonitor ( monitor, 90 ) );
    }
    finally
    {
        monitor.done ();
    }
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:27,代码来源:RecipeHelper.java

示例5: run

import org.eclipse.core.runtime.IProgressMonitor; //导入方法依赖的package包/类
@Override
protected IStatus run(IProgressMonitor monitor) {
    try {
        Log.log(Log.LOG_INFO, "Update DDL starting"); //$NON-NLS-1$
        SubMonitor.convert(monitor).setTaskName(Messages.SqlEditor_update_ddl);

        scriptThread.start();

        while(scriptThread.isAlive()) {
            Thread.sleep(20);
            if(monitor.isCanceled()) {
                ConsoleFactory.write(Messages.sqlScriptDialog_script_execution_interrupted);
                Log.log(Log.LOG_INFO, "Script execution interrupted by user"); //$NON-NLS-1$

                scriptThread.interrupt();
                return Status.CANCEL_STATUS;
            }
        }
        return Status.OK_STATUS;
    } catch (InterruptedException ex) {
        scriptThread.interrupt();
        return Status.CANCEL_STATUS;
    } finally {
        monitor.done();
    }
}
 
开发者ID:pgcodekeeper,项目名称:pgcodekeeper,代码行数:27,代码来源:SQLEditor.java

示例6: performTasks

import org.eclipse.core.runtime.IProgressMonitor; //导入方法依赖的package包/类
public void performTasks(IProgressMonitor monitor) throws IOException, InterruptedException {
	File rootDir = configAdoc.getDocRootDir();
	FileSystem.ensureFileStructure(rootDir);
	int workload = 1;

	SubMonitor subMonitor = SubMonitor.convert(monitor, workload);

	if (configOutput.writeAdocFiles) {
		writeAdocFiles(subMonitor);
	}

	subMonitor.subTask("Finished.");
	subMonitor.done();
	monitor.done();
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:16,代码来源:TaskWriteFiles.java

示例7: run

import org.eclipse.core.runtime.IProgressMonitor; //导入方法依赖的package包/类
@Override
public void run(IProgressMonitor monitor, CancellationToken token) {
	monitor.beginTask("Init Gluon project", IProgressMonitor.UNKNOWN);
	try {
		File projectDir = new File(projectData.projectLocation);
		if (!projectDir.exists()) {
			if (projectDir.mkdir()) {
				operation.perform(monitor, projectDir);
			}
		}
	} finally {
		monitor.done();
	}
}
 
开发者ID:gluonhq,项目名称:ide-plugins,代码行数:15,代码来源:GluonProjectWizard.java

示例8: createProjectContents

import org.eclipse.core.runtime.IProgressMonitor; //导入方法依赖的package包/类
private void createProjectContents(IProgressMonitor mon, File projectDir) {
	mon.beginTask("Create project contents", 1);
	try {
		Map<String, Object> parameters = projectData.asParameters();
		parameters.put(ProjectConstants.PARAM_PROJECT_NAME, projectData.projectName);
		
		parameters.put(ProjectConstants.PARAM_GLUON_DESKTOP_VERSION, ProjectConstants.getDesktopVersion());
		parameters.put(ProjectConstants.PARAM_GLUON_MOBILE_VERSION, ProjectConstants.getMobileVersion());
		parameters.put(ProjectConstants.PARAM_GLUON_MOBILE_GVM_VERSION, ProjectConstants.getMobileGvmVersion());
		parameters.put(ProjectConstants.PARAM_GLUON_DOWN_VERSION, ProjectConstants.getDownVersion());
		parameters.put(ProjectConstants.PARAM_GLUON_MOBILE_PLUGIN, ProjectConstants.getPluginVersion());
		parameters.put(ProjectConstants.PARAM_GLUON_MOBILE_GVM_PLUGIN, ProjectConstants.getPluginGvmVersion());
		parameters.put(ProjectConstants.PARAM_GLUON_GLISTEN_AFTERBURNER_VERSION, ProjectConstants.getGlistenAfterburnerVersion());

		List<File> filesToOpen = new ArrayList<>();
		if (projectTemplate != null) {
			projectTemplate.render(projectDir, parameters);
			filesToOpen.addAll(projectTemplate.getFilesToOpen());

			if (sourceTemplate != null) {
				sourceTemplate.render(projectDir, parameters);
				filesToOpen.addAll(sourceTemplate.getFilesToOpen());
			}
		}
		
		// TODO: open files
	} finally {
		mon.done();
	}
}
 
开发者ID:gluonhq,项目名称:ide-plugins,代码行数:31,代码来源:GluonProjectApplicationOperation.java

示例9: safePrint

import org.eclipse.core.runtime.IProgressMonitor; //导入方法依赖的package包/类
/** deal with not justified and large string
 * this is because large string may block Eclipse UI
 */
protected void safePrint(String message, final Color c, final int style, IProgressMonitor monitor){
	try {
		String justifiedMsg = justifyMessage(message);
		if(justifiedMsg.length() > LARGE_MESSAGE_SIZE){
			// deal with large messages ... chunk the message
			int nbChunk = justifiedMsg.length()/LARGE_MESSAGE_SIZE;
			monitor.beginTask("writing large string to the console", nbChunk+1);
			int start, end= 0;
			for(int i = 0; i< nbChunk; i++){
				start = LARGE_MESSAGE_SIZE*i;
				end = LARGE_MESSAGE_SIZE*i + LARGE_MESSAGE_SIZE;
				changeStream();
				safeChangeStyle(c, style);
				((IOConsoleOutputStream)getOutputStream()).write(justifiedMsg.substring(start, end));
				monitor.worked(1);
			}
			changeStream();
			safeChangeStyle(c, style);
			((IOConsoleOutputStream)getOutputStream()).write(justifiedMsg.substring(end, justifiedMsg.length()));
			monitor.done();
		}
		else{
			safeChangeStyle(c, style);
			((IOConsoleOutputStream)getOutputStream()).write(justifiedMsg);
		}
	} catch (IOException e) {
		e.printStackTrace();
	}
}
 
开发者ID:eclipse,项目名称:gemoc-studio,代码行数:33,代码来源:EclipseConsoleIO.java

示例10: run

import org.eclipse.core.runtime.IProgressMonitor; //导入方法依赖的package包/类
@Override
  public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
      int totalUnitsOfWork = IProgressMonitor.UNKNOWN;
      monitor.beginTask("Performing read. Please wait...", totalUnitsOfWork);
      // This only performs the tasks
try {
	client.setCredentials(Constants.USERNAME, Constants.PASSWORD);
	System.out.println(getClient().getUser());
	issues = loadRequirements();
} catch (IOException e) {
	e.printStackTrace();
}
      monitor.done();
  }
 
开发者ID:ModelWriter,项目名称:Tarski,代码行数:15,代码来源:FetchSoftwareRequirements.java

示例11: run

import org.eclipse.core.runtime.IProgressMonitor; //导入方法依赖的package包/类
@Override
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
  int totalUnitsOfWork = IProgressMonitor.UNKNOWN;
  monitor.beginTask("Performing read. Please wait...", totalUnitsOfWork);
  // This only performs the tasks
  try {
    client.setCredentials(Constants.USERNAME, Constants.PASSWORD);
    System.out.println(getClient().getUser());
    issues = loadRequirements();
  } catch (IOException e) {
    e.printStackTrace();
  }
  monitor.done();
}
 
开发者ID:ModelWriter,项目名称:Tarski,代码行数:15,代码来源:FetchSoftwareRequirementReviewMeeting.java

示例12: createResourceOperation

import org.eclipse.core.runtime.IProgressMonitor; //导入方法依赖的package包/类
protected IRunnableWithProgress createResourceOperation(IFolder folder,InitialBuildPolicies policies) {
	WorkspaceModifyOperation operation = new WorkspaceModifyOperation() {
		@Override
		protected void execute(IProgressMonitor monitor) {
			String resource = "";
			String targetFile = "";
			try {
				for (int i = 0; i < resources.length; i++) {
					resource = resources[i];
					targetFile =  targetFiles[i];
					IFile file =  create(folder, resource, targetFile, monitor);
					if (file != null) {
						createdResources.add(file);
						policies.setFile(file);
						policies.run();
						BasicNewResourceWizard.selectAndReveal(file,
								PlatformUI.getWorkbench().getActiveWorkbenchWindow());
					}
				}			
			} catch (Exception exception) {
				ResourceManager.logException(exception, "Unable to create " + resource);
			} finally {
				monitor.done();
			}
		}
	};
	return operation;
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:29,代码来源:TemplateProvider.java

示例13: postContent

import org.eclipse.core.runtime.IProgressMonitor; //导入方法依赖的package包/类
@Override
public void postContent(@NonNull TaskRepository repository, @NonNull ITask task,
		@NonNull AbstractTaskAttachmentSource source, @Nullable String comment,
		@Nullable TaskAttribute attachmentAttribute, @Nullable IProgressMonitor monitor) throws CoreException {

	monitor.beginTask("Uploading attachment", 1);

	CharmClient client = connector.getClient(repository);

	try {
		byte attachment[] = readData(source, monitor);

		String filename = source.getName();
		String description = source.getDescription();

		if (CONTEXT_DESCRIPTION.equals(source.getDescription()))
			filename = CONTEXT_DESCRIPTION + "-" + dateFormat.format(new Date()) + ".zip";

		else if (attachmentAttribute != null) {
			TaskAttachmentMapper mapper = TaskAttachmentMapper.createFrom(attachmentAttribute);
			if (mapper.getFileName() != null)
				filename = mapper.getFileName();
			if (mapper.getDescription() != null)
				description = mapper.getDescription();
		}

		client.putAttachmentData(task, filename, source.getContentType(), description, attachment, monitor);
		Policy.advance(monitor, 1);

	} catch (IOException | CharmHttpException e) {
		throw new CoreException(new Status(IStatus.ERROR, CharmCorePlugin.PLUGIN_ID,
				NLS.bind("Uploading attachment failed: {0}", e.getMessage(), e)));
	} finally {
		monitor.done();
	}

}
 
开发者ID:theits,项目名称:CharmMylynConnector,代码行数:38,代码来源:CharmTaskAttachmentHandler.java

示例14: 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

示例15: run

import org.eclipse.core.runtime.IProgressMonitor; //导入方法依赖的package包/类
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
    // DebugLog.println("Running task");
    monitor.beginTask("Running task ", IProgressMonitor.UNKNOWN);
    if (simpleThread != null) {
        simpleThread.start();
        simpleThread.join();
    }
    // DebugLog.println("Task complete.");
    monitor.done();
    if (monitor.isCanceled())
        throw new InterruptedException("The operation was cancelled");
}
 
开发者ID:openaudible,项目名称:openaudible,代码行数:13,代码来源:ProgressDialog.java


注:本文中的org.eclipse.core.runtime.IProgressMonitor.done方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。