當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。