Package org.eclipse.core.runtime

Examples of org.eclipse.core.runtime.SubMonitor


    }
  }

  public static void register(String location, String userName, String password, boolean selfSigned,
      IProgressMonitor monitor) throws CoreException {
    SubMonitor progress = SubMonitor.convert(monitor);
    progress.beginTask("Connecting", IProgressMonitor.UNKNOWN); //$NON-NLS-1$
    try {
      CloudFoundryOperations client = createClient(location, userName, password, selfSigned);
      client.register(userName, password);
    }
    catch (RestClientException e) {
      throw CloudErrorUtil.toCoreException(e);
    }
    catch (RuntimeException e) {
      // try to guard against IOException in parsing response
      throw CloudErrorUtil.checkServerCommunicationError(e);

    }
    finally {
      progress.done();
    }
  }
View Full Code Here


  }

  private ApplicationArchive getApplicationArchive(CloudFoundryApplicationModule cloudModule,
      IProgressMonitor monitor, AbstractApplicationDelegate delegate, IModuleResource[] resources)
      throws CoreException {
    SubMonitor subProgress = SubMonitor.convert(monitor);
    subProgress.setTaskName("Creating application archive for: " + cloudModule.getDeployedApplicationName()); //$NON-NLS-1$

    ApplicationArchive archive = null;
    try {
      archive = delegate.getApplicationArchive(cloudModule, getCloudFoundryServer(), resources, monitor);
    }
    finally {
      subProgress.done();
    }
    return archive;
  }
View Full Code Here

    {
        Collection<ISigilProjectModel> projects = getRoot().getProjects();
       
        if (!projects.isEmpty())
        {
            SubMonitor progress = SubMonitor.convert(monitor, projects.size() * 20);
            for (ISigilProjectModel p : projects)
            {
                rebuild(p, progress);
            }
        }
View Full Code Here

        if (project != null)
        {
            affected.remove(project);
        }

        SubMonitor progress = SubMonitor.convert(monitor, affected.size() * 20);
        for (ISigilProjectModel dependent : affected)
        {
            //dependent.flushDependencyState();
            rebuild(dependent, progress);
        }
View Full Code Here

    /* (non-Javadoc)
     * @see org.apache.felix.sigil.common.progress.IProgress#newTask(int)
     */
    public IProgress newTask(int totalWork)
    {
        SubMonitor sub = SubMonitor.convert(monitor);
        return new ProgressAdapter(sub);
    }
View Full Code Here

                    for (IBundleRepository rep : repositories ) {
                        rep.refresh();                       
                    }
                   
                    List<ISigilProjectModel> projects = SigilCore.getRoot().getProjects();
                    SubMonitor sub = SubMonitor.convert(monitor, projects.size() * 10);
                    for (ISigilProjectModel p : projects)
                    {
                        p.resetClasspath(sub.newChild(10), false);
                    }
                }
            }
        };

View Full Code Here

                            + sourceProject.getSymbolicName()
                            + ", this may effect client bundles that use require bundle");
                    }
                    else
                    {
                        SubMonitor sub = SubMonitor.convert(monitor);
                       
                        sub.beginTask("Resolving package users", 200);
                       
                        Set<String> users = JavaHelper.findLocalPackageUsers(
                            sourceProject, packageName, sub.newChild(100));
                        Set<String> dependencies = JavaHelper.findLocalPackageDependencies(
                            sourceProject, packageName, sub.newChild(100));

                        if (users.size() > 0 && dependencies.size() > 0)
                        {
                            status.addWarning("Package " + packageName
                                + " is coupled to " + users + " and " + dependencies
View Full Code Here

    }

    public void save(IProgressMonitor monitor, boolean rebuildDependencies)
        throws CoreException
    {
        SubMonitor progress = SubMonitor.convert(monitor, 1000);

        if (bldProjectFile.getLocation().toFile().exists())
        {
            bldProjectFile.setContents(buildContents(), IFile.KEEP_HISTORY,
                progress.newChild(10));
        }
        else
        {
            bldProjectFile.create(buildContents(), true /* force */,
                progress.newChild(5));
            project.refreshLocal(IResource.DEPTH_ONE, progress.newChild(5));
        }

        if (rebuildDependencies)
        {
            rebuildDependencies(progress.newChild(900));
        }
    }
View Full Code Here

        }
    }

    public void rebuildDependencies(IProgressMonitor monitor) throws CoreException
    {
        SubMonitor progress = SubMonitor.convert(monitor, 1000);

        HashSet<ICapabilityModelElement> changes = new HashSet<ICapabilityModelElement>(
            lastCaps);

        LinkedList<IRequirementModelElement> reqs = new LinkedList<IRequirementModelElement>();
        LinkedList<ICapabilityModelElement> caps = new LinkedList<ICapabilityModelElement>();

        checkChanges(progress.newChild(100), reqs, caps);

        boolean reqsChanged;
        boolean capsChanged;

        synchronized (this)
        {
            reqsChanged = isRequirementsChanged(reqs);
            capsChanged = isCapabilitiesChanged(caps);
        }

        if (reqsChanged)
        {
            processRequirementsChanges(progress.newChild(600));
            SigilCore.rebuild(this, progress.newChild(50));
        }

        progress.setWorkRemaining(250);

        if (capsChanged)
        {
            changes.addAll(caps);
            SigilCore.rebuildBundleDependencies(this, changes, progress.newChild(250));
        }
    }
View Full Code Here

    }

    private void processRequirementsChanges(IProgressMonitor monitor)
        throws CoreException
    {
        SubMonitor progress = SubMonitor.convert(monitor, 100);

        IRepositoryManager manager = getRepositoryManager();
        ResolutionConfig config = new ResolutionConfig(ResolutionConfig.INCLUDE_OPTIONAL
            | ResolutionConfig.IGNORE_ERRORS);

        try
        {
            IResolution resolution = manager.getBundleResolver().resolve(this, config,
                new ResolutionMonitorAdapter(progress.newChild(20)));

            markProblems(resolution);

            // pull remote bundles from repositories to be added to classpath
            if (!resolution.isSynchronized())
            {
                resolution.synchronize(new ProgressAdapter(progress.newChild(80)));
            }
        }
        catch (ResolutionException e)
        {
            throw SigilCore.newCoreException("Failed to resolve dependencies", e);
View Full Code Here

TOP

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

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.