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


Java IProgressMonitor.subTask方法代码示例

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


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

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

示例2: process

import org.eclipse.core.runtime.IProgressMonitor; //导入方法依赖的package包/类
public void process (
        @Named ( "phase" )
        final String phase,
        final World world, final IContainer output, final IProgressMonitor monitor ) throws Exception
{
    monitor.beginTask ( "Processing world", world.getNodes ().size () );

    for ( final Node node : world.getNodes () )
    {
        monitor.subTask ( String.format ( "Processing node: %s", Nodes.makeName ( node ) ) );
        if ( node instanceof ApplicationNode )
        {
            processNode ( phase, world, (ApplicationNode)node, output, new SubProgressMonitor ( monitor, 1 ) );
        }
    }

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

示例3: progress

import org.eclipse.core.runtime.IProgressMonitor; //导入方法依赖的package包/类
@Override
public void progress(String progressGroup, String msg, String msgGroup, int workedUnit) {
	boolean mustLog = false;
	IProgressMonitor progressMonitor = getProgressMonitor(progressGroup);		
	if(progressMonitor != null){
		progressMonitor.subTask(msg);
		progressMonitor.worked(workedUnit*progressBarScale);
	}
	else{
		mustLog = true;
	}
	
	// for the moment forward all messages to usual log
	Kind logLevel;
	if(mustLog){
		logLevel = Kind.UserINFO;
	}
	else logLevel = Kind.DevINFO;
	this.log(logLevel, "["+progressGroup+"]"+ msg+getIntermediateElapsedTime(progressGroup), msgGroup);
	
}
 
开发者ID:eclipse,项目名称:gemoc-studio,代码行数:22,代码来源:EclipseMessagingSystem.java

示例4: doGenerate

import org.eclipse.core.runtime.IProgressMonitor; //导入方法依赖的package包/类
/**
 * Launches the generation.
 * 
 * @param monitor
 *            This will be used to display progress information to the user.
 * @generated NOT
 */
@SuppressWarnings ( "unchecked" )
public void doGenerate ( final IProgressMonitor monitor ) throws Exception
{
    if ( !this.targetFolder.getLocation ().toFile ().exists () )
    {
        this.targetFolder.getLocation ().toFile ().mkdirs ();
    }

    // final URI template0 = getTemplateURI("org.eclipse.scada.protocol.ngp.generator", new Path("/org/eclipse/scada/protocol/ngp/generator/main/generate.emtl"));
    // org.eclipse.scada.protocol.ngp.generator.main.Generate gen0 = new org.eclipse.scada.protocol.ngp.generator.main.Generate(modelURI, targetFolder.getLocation().toFile(), arguments) {
    //	protected URI createTemplateURI(String entry) {
    //		return template0;
    //	}
    //};
    //gen0.doGenerate(BasicMonitor.toMonitor(monitor));
    monitor.subTask ( "Loading..." );

    final Class<? extends AbstractAcceleoGenerator> clazz = (Class<? extends AbstractAcceleoGenerator>)Activator.getDefault ().getBundle ().loadClass ( this.main );
    final Constructor<? extends AbstractAcceleoGenerator> ctor = clazz.getConstructor ( URI.class, File.class, List.class );
    final AbstractAcceleoGenerator gen0 = ctor.newInstance ( this.modelURI, this.targetFolder.getLocation ().toFile (), this.arguments );

    // final AbstractAcceleoGenerator gen0 = new org.eclipse.scada.protocol.ngp.generator.main.Generate ( this.modelURI, this.targetFolder.getLocation ().toFile (), this.arguments );
    monitor.worked ( 1 );

    final String generationID = org.eclipse.acceleo.engine.utils.AcceleoLaunchingUtil.computeUIProjectID ( "org.eclipse.scada.protocol.ngp.generator", this.main, this.modelURI.toString (), this.targetFolder.getFullPath ().toString (), new ArrayList<String> () );
    gen0.setGenerationID ( generationID );
    gen0.doGenerate ( BasicMonitor.toMonitor ( monitor ) );
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:36,代码来源:GenerateAll.java

示例5: loadData

import org.eclipse.core.runtime.IProgressMonitor; //导入方法依赖的package包/类
public static Collection<FactoryInformation> loadData ( final IProgressMonitor monitor, final Connection connection ) throws Exception
{
    final Collection<FactoryInformation> result = new LinkedList<FactoryInformation> ();
    try
    {
        if ( connection == null )
        {
            throw new IllegalStateException ( Messages.ConfigurationHelper_NoConnection );
        }

        final NotifyFuture<FactoryInformation[]> future = connection.getFactories ();
        final FactoryInformation[] factories = future.get ();
        monitor.beginTask ( Messages.ConfigurationHelper_TaskName, factories.length );
        for ( final FactoryInformation factory : factories )
        {
            monitor.subTask ( String.format ( Messages.ConfigurationHelper_SubTaskNameFormat, factory.getId () ) );
            result.add ( connection.getFactoryWithData ( factory.getId () ).get () );
            monitor.worked ( 1 );
            if ( monitor.isCanceled () )
            {
                return null;
            }
        }
    }
    finally
    {
        monitor.done ();
    }
    return result;
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:31,代码来源:ConfigurationHelper.java

示例6: processUri

import org.eclipse.core.runtime.IProgressMonitor; //导入方法依赖的package包/类
public void processUri ( final URI input, final IContainer output, final IProgressMonitor monitor ) throws Exception
{
    logger.debug ( "Processing file: {}", input ); //$NON-NLS-1$

    monitor.subTask ( "Loading model" );

    process ( null, new ModelLoader<World> ( World.class ).load ( input ), output, monitor );
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:9,代码来源:WorldRunner.java

示例7: doneProgress

import org.eclipse.core.runtime.IProgressMonitor; //导入方法依赖的package包/类
@Override
public void doneProgress(String progressGroup, String msg, String msgGroup) {

	boolean mustLog = false;
	IProgressMonitor progressMonitor =  getProgressMonitor(progressGroup);
	
	if(progressMonitor != null){
		progressMonitor.subTask(msg);
		progressMonitor.done();
		
		if(progressMonitor != null){
			releaseProgressMonitor(progressGroup);
		}
	}
	else{
		mustLog = true;
	}
	
	
	// for the moment forward all messages to usual log
	Kind logLevel;
	if(mustLog){
		logLevel = Kind.UserINFO;
	}
	else logLevel = Kind.DevINFO;
	this.log(logLevel, "["+progressGroup+"]"+ msg+getElapsedTime(progressGroup), msgGroup);		
	
}
 
开发者ID:eclipse,项目名称:gemoc-studio,代码行数:29,代码来源:EclipseMessagingSystem.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.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

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

示例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: 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.alloy.main.Generate gen0 = new org.eclipse.cmf.occi.core.gen.alloy.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.alloy", "org.eclipse.cmf.occi.core.gen.alloy.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

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

示例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.curl.main.Generate gen0 = new org.eclipse.cmf.occi.core.gen.curl.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.curl", "org.eclipse.cmf.occi.core.gen.curl.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

示例15: storeExcel

import org.eclipse.core.runtime.IProgressMonitor; //导入方法依赖的package包/类
private IStatus storeExcel ( final File file, final List<Event> events, final List<Field> columns, final IProgressMonitor monitor ) throws IOException
{
    final HSSFWorkbook workbook = new HSSFWorkbook ();

    final HSSFDataFormat dateFormat = workbook.createDataFormat ();
    final HSSFCellStyle dateCellStyle = workbook.createCellStyle ();
    dateCellStyle.setDataFormat ( dateFormat.getFormat ( "YYYY-MM-DD hh:mm:ss.000" ) );

    try
    {
        monitor.beginTask ( Messages.ExportImpl_Progress_ExportingEvents, events.size () + 3 + columns.size () );

        try
        {
            monitor.subTask ( Messages.ExportImpl_Progress_CreateWorkbook );
            monitor.worked ( 1 );

            final HSSFSheet sheet = createSheet ( events, workbook, columns );
            monitor.worked ( 1 );

            monitor.setTaskName ( Messages.ExportImpl_Progress_ExportEvents );

            for ( int i = 0; i < events.size (); i++ )
            {
                final HSSFRow row = sheet.createRow ( i + 1 );

                final Event e = events.get ( i );
                for ( int j = 0; j < columns.size (); j++ )
                {
                    final Field field = columns.get ( j );
                    final ExcelCell cell = new ExcelCell ( row, j, dateCellStyle );
                    field.render ( e, cell );
                }
                monitor.worked ( 1 );
                if ( monitor.isCanceled () )
                {
                    return Status.CANCEL_STATUS;
                }
            }

            sheet.setRepeatingRows ( new CellRangeAddress ( 0, 1, -1, -1 ) );

            monitor.setTaskName ( "Auto sizing" );
            for ( int i = 0; i < columns.size (); i++ )
            {
                monitor.subTask ( String.format ( "Auto sizing column: %s", columns.get ( i ).getHeader () ) );
                sheet.autoSizeColumn ( i );
                monitor.worked ( 1 );

                if ( monitor.isCanceled () )
                {
                    return Status.CANCEL_STATUS;
                }
            }

        }
        finally
        {
            monitor.subTask ( Messages.ExportImpl_Progress_CloseFile );
            if ( workbook != null )
            {
                makeDocInfo ( workbook );

                final FileOutputStream stream = new FileOutputStream ( file );
                workbook.write ( stream );
                stream.close ();
            }
            monitor.worked ( 1 );
        }
    }
    finally
    {
        monitor.done ();
    }

    return Status.OK_STATUS;
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:78,代码来源:ExportEventsImpl.java


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