Package org.eclipse.core.runtime

Examples of org.eclipse.core.runtime.IProgressMonitor


          });
        } catch (CoreException e) {
        }*/
       
        try {
          final IProgressMonitor fMonitor = monitor;
          fMonitor.beginTask("Validating resources", IProgressMonitor.UNKNOWN);
          fResource.accept(new IResourceVisitor() {
           
            public boolean visit(IResource resource) throws CoreException {
              if (resource instanceof IFile) {
                IFile file = (IFile) resource;
                if (WGADesignResourceValidator.shouldBeValidated(file)) {
                  try {
                    fMonitor.setTaskName("Validating '" + file.getLocation().toString() + "'.");
                    WGADesignResourceValidator.validate(file);
                    fMonitor.worked(1);                     
                  } catch (Exception e) { 
                  }
                }
              }
              if (resource instanceof IContainer) {
                IContainer container = (IContainer) resource;
                if (WGADesignResourceValidator.shouldBeValidated(container)) {
                  try {
                    fMonitor.setTaskName("Validating '" + container.getLocation().toString() + "'.");
                    WGADesignResourceValidator.validate(container);
                    fMonitor.worked(1);                     
                  } catch (Exception e) { 
                  }
                }
              }
              if (!fMonitor.isCanceled()) {
                return true;
              } else {
                return false;
              }
            }
View Full Code Here


    /* In case response body is not available */
    if (inS == null)
      throw new ConnectionException(Activator.getDefault().createErrorStatus(Messages.DefaultProtocolHandler_ERROR_STREAM_UNAVAILABLE, null));

    /* Check wether a Progress Monitor is provided to support early cancelation */
    IProgressMonitor monitor = null;
    if (properties != null && properties.containsKey(IConnectionPropertyConstants.PROGRESS_MONITOR))
      monitor = (IProgressMonitor) properties.get(IConnectionPropertyConstants.PROGRESS_MONITOR);

    /* Return a Stream that releases the connection once closed */
    return new HttpConnectionInputStream(link, method, monitor, inS);
View Full Code Here

    setControl(container);
  }

  private void onCancel() {
    if (fCurrentProgressMonitor != null && getShell() != null && !getShell().isDisposed()) {
      IProgressMonitor monitor = fCurrentProgressMonitor;
      monitor.setTaskName(Messages.ImportElementsPage_CANCEL_SEARCH);
      monitor.subTask(""); //$NON-NLS-1$
    }
  }
View Full Code Here

    /* In case response body is not available */
    if (inS == null)
      throw new ConnectionException(Activator.getDefault().createErrorStatus("Response Stream is not available!", null)); //$NON-NLS-1$

    /* Check wether a Progress Monitor is provided to support early cancelation */
    IProgressMonitor monitor = null;
    if (properties != null && properties.containsKey(IConnectionPropertyConstants.PROGRESS_MONITOR))
      monitor = (IProgressMonitor) properties.get(IConnectionPropertyConstants.PROGRESS_MONITOR);

    /* Return a Stream that releases the connection once closed */
    return new HttpConnectionInputStream(getMethod, monitor, inS);
View Full Code Here

        try {
            initLabels();
            Differencer differencer = new Differencer();
            monitor.beginTask("Bytecode Outline: comparing...", 30); //$NON-NLS-1$
            IProgressMonitor sub = new SubProgressMonitor(monitor, 10);
            try {
                sub.beginTask("Bytecode Outline: comparing...", 100); //$NON-NLS-1$

                return differencer.findDifferences(
                    false, sub, null, null, left, right);
            } finally {
                sub.done();
            }
        } catch (OperationCanceledException e) {
            throw new InterruptedException(e.getMessage());
        } finally {
            monitor.done();
View Full Code Here

    public void run(final File outputFile, final ExportFinalizationJob finalizationJob)
    throws Exception {
        final IJobManager jobManager = Platform.getJobManager();
        final List resultFiles = new ArrayList();
        final Job[] jobs = createJobs(outputFile, resultFiles);
        final IProgressMonitor monitor = jobManager.createProgressGroup();
        final IProgressMonitor familyMonitor = new IProgressMonitor() {
      public void beginTask(String name, int totalWork) {
        monitor.beginTask(name, totalWork);
      }
      public void done() {
        monitor.done();
View Full Code Here

    WebPublisher() {
    }

    public void run(final File[] exportFiles, final DocumentManager.FTPOptions options, UIFacade uiFacade) {
        IJobManager jobManager = Platform.getJobManager();
        IProgressMonitor monitor = jobManager.createProgressGroup();
          Job startingJob = new Job("starting") {
        protected IStatus run(IProgressMonitor monitor) {
          monitor.beginTask("Publishing files on FTP", exportFiles.length);
          try{
                final URL baseUrl = buildURL(options);
                if (baseUrl==null) {
                  throw new RuntimeException("Failed to discover your FTP settings. Please make sure that you specified server name and user name");
                }
                for (int i=0; i<exportFiles.length; i++) {
                    Job nextJob = createTransferJob(baseUrl, exportFiles[i]);
                    nextJob.setProgressGroup(monitor, 1);
                    nextJob.schedule();
                    nextJob.join();
                }
                Job finishingJob = new Job("finishing") {
            protected IStatus run(IProgressMonitor monitor) {
              monitor.done();
              return Status.OK_STATUS;
            }
                };
                finishingJob.setProgressGroup(monitor, 0);
                finishingJob.schedule();
View Full Code Here

  try {
    // optimize access to zip files while building hierarchy
    manager.cacheZipFiles();
       
    if (this.hierarchy.focusType == null || computeSubtypes) {
      IProgressMonitor typeInRegionMonitor =
        this.hierarchy.progressMonitor == null ?
          null :
          new SubProgressMonitor(this.hierarchy.progressMonitor, 30);
      HashMap allOpenablesInRegion = determineOpenablesInRegion(typeInRegionMonitor);
      this.hierarchy.initialize(allOpenablesInRegion.size());
      IProgressMonitor buildMonitor =
        this.hierarchy.progressMonitor == null ?
          null :
          new SubProgressMonitor(this.hierarchy.progressMonitor, 70);
      createTypeHierarchyBasedOnRegion(allOpenablesInRegion, buildMonitor);
      ((RegionBasedTypeHierarchy)this.hierarchy).pruneDeadBranches();
View Full Code Here

* Add an additional binary type
* @param binaryType
* @param packageBinding
*/
public void accept(IBinaryType binaryType, PackageBinding packageBinding, AccessRestriction accessRestriction) {
  IProgressMonitor progressMonitor = this.builder.hierarchy.progressMonitor;
  if (progressMonitor != null && progressMonitor.isCanceled())
    throw new OperationCanceledException();
 
  BinaryTypeBinding typeBinding = this.lookupEnvironment.createBinaryTypeFrom(binaryType, packageBinding, accessRestriction);
  try {
    this.remember(binaryType, typeBinding);
View Full Code Here

* Add additional source types
* @param sourceTypes
* @param packageBinding
*/
public void accept(ISourceType[] sourceTypes, PackageBinding packageBinding, AccessRestriction accessRestriction) {
  IProgressMonitor progressMonitor = this.builder.hierarchy.progressMonitor;
  if (progressMonitor != null && progressMonitor.isCanceled())
    throw new OperationCanceledException();
 
  // find most enclosing type first (needed when explicit askForType(...) is done
  // with a member type (e.g. p.A$B))
  ISourceType sourceType = sourceTypes[0];
View Full Code Here

TOP

Related Classes of org.eclipse.core.runtime.IProgressMonitor

Copyright © 2018 www.massapicom. 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.