Package org.eclipse.core.runtime

Examples of org.eclipse.core.runtime.SubProgressMonitor.worked()


                      new BufferedInputStream(exec.getInputStream())));

              if (!monitor.isCanceled()) {
                exec.connect();
                String line = reader.readLine();
                sub.worked(1);
              }

              if (exec.isConnected()) {
                exec.disconnect();
              }
View Full Code Here


                }               
                java.awt.Point p = getContext().worldToPixel(worldLocation);
                g.fillOval(p.x, p.y, 10, 10);
                String name = row[nameIndex];
                g.drawString(name, p.x + 15, p.y + 15);
                drawMonitor.worked(1);

                if (drawMonitor.isCanceled())
                    break;
            }
            drawMonitor.done();           
View Full Code Here

        FeatureIterator<SimpleFeature> featureIterator = features.features();
        try{
            SubProgressMonitor monitor2 = new SubProgressMonitor(monitor, 98);
            monitor2.beginTask("this is ignored", features.size());
            while(featureIterator.hasNext() ){
                monitor2.worked(1);
                SimpleFeature feature=featureIterator.next();
               
                // do something.
                // the features here will have no attributes or geometry but you can call getID().
                // warning you can't call getBounds() because no geometry was requested in the query.
View Full Code Here

      SubProgressMonitor subMonitor = null;
      try {
        if (monitor != null) {
          subMonitor = new SubProgressMonitor(monitor, 50); // 50% of the time is spent in initializing containers and variables
          subMonitor.beginTask("", 100); //$NON-NLS-1$
          subMonitor.worked(5); // give feedback to the user that something is happening
          manager.batchContainerInitializationsProgress.initializeAfterLoadMonitor.set(subMonitor);
        }
        if (manager.forceBatchInitializations(true/*initAfterLoad*/)) { // if no other thread has started the batch container initializations
          manager.getClasspathContainer(Path.EMPTY, null); // force the batch initialization
        } else { // else wait for the batch initialization to finish
View Full Code Here

          manager.getClasspathContainer(Path.EMPTY, null); // force the batch initialization
        } else { // else wait for the batch initialization to finish
          while (manager.batchContainerInitializations == JavaModelManager.BATCH_INITIALIZATION_IN_PROGRESS) {
            if (subMonitor != null) {
              subMonitor.subTask(manager.batchContainerInitializationsProgress.subTaskName);
              subMonitor.worked(manager.batchContainerInitializationsProgress.getWorked());
            }
            synchronized(manager) {
              try {
                manager.wait(100);
              } catch (InterruptedException e) {
View Full Code Here

    {
      IPath destination = generateImageDestination(cls, ".png");
      monitor.subTask("Saving PNG image " + destination.lastSegment());
      CopyToImageUtil img = getCopyToImageUtil();
      img.copyToImage(part, destination, ImageFileFormat.PNG, new SubProgressMonitor(monitor, 1));
      saveMonitor.worked(1);
    }

    // issue 193: then save as svg
    {
      IPath destination = generateImageDestination(cls, ".svg");
View Full Code Here

    {
      IPath destination = generateImageDestination(cls, ".svg");
      monitor.subTask("Saving SVG image " + destination.lastSegment());
      CopyToImageUtil img = getCopyToImageUtil();
      img.copyToImage(part, destination, ImageFileFormat.SVG, new SubProgressMonitor(monitor, 1));
      saveMonitor.worked(1);
    }

    saveMonitor.done();
   
    // close the editor once we're done
View Full Code Here

        .append(getHTMLFooter());
     
      // add the SVG
      latexMap.put(resolved, getLatexTag(resolved, destination));
     
      finalMonitor.worked(1);
     
      // export HTML page
      try {
        File destFile = new File(htmlDestination.toOSString());
        FileWriter fw = new FileWriter(destFile);
View Full Code Here

        fw.write(html.toString());
        fw.close();
      } catch (IOException e) {
        throw new ExportImageException("Could not export individual HTML page '" + htmlDestination + "': " + e.getMessage(), e);
      }
      finalMonitor.worked(1);
    }
   
    // export Latex page
    IPath latexDestination = targetDiagram.getLocation().removeFileExtension().addFileExtension("tex");
    try {
View Full Code Here

      Collections.sort(objectList, new EObjectDepthComparator());
      for (EObject obj : objectList) {
        fw.write(latexMap.get(obj));
      }
      fw.close();
      finalMonitor.worked(5);
    } catch (IOException e) {
      throw new ExportImageException("Could not export Latex page '" + latexDestination + "': " + e.getMessage(), e);
    }
   
    finalMonitor.done();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.