Package org.eclipse.core.runtime

Examples of org.eclipse.core.runtime.IProgressMonitor


    /*
     * @see org.locationtech.udig.catalog.IResolve#members(org.eclipse.core.runtime.IProgressMonitor)
     */
    public List<IResolve> members( IProgressMonitor monitor2 ) {
        IProgressMonitor monitor = monitor2;
        if (monitor == null)
            monitor = new NullProgressMonitor();
        monitor.beginTask(Messages.CatalogImpl_finding, 1);
        monitor.done();
        return new LinkedList<IResolve>(services);
    }
View Full Code Here


        //If there is less than 2 IService there is no sorting required.
        if(services.size() < 2){
            return services;
        }
       
        final IProgressMonitor monitor2 = new SubProgressMonitor(monitor, 60);

        class IServiceComparator implements Comparator<IService> {
           
            public int compare( IService o1, IService o2 ) {
                try {
View Full Code Here

        try {
            List<IService> possible = factory.createService(url);
            monitor.worked(urlProcessCount);

            IProgressMonitor monitor3 = new SubProgressMonitor(monitor, 60);
            monitor3.beginTask("connect", possible.size() * 10);

            for( Iterator<IService> iterator = possible.iterator(); iterator.hasNext(); ) {
                IService service = iterator.next();

                if (service == null) continue;

                monitor3.subTask("connect " + service.getID());
                try {
                    // try connecting
                    IServiceInfo info = service.getInfo(new SubProgressMonitor(monitor3, 10));

                    if (info == null) {
                        CatalogPlugin.trace("unable to connect to " + service.getID(), null);
                        continue; // skip unable to connect
                    }

                    availableServices.add(service);
                } catch (Throwable t) {
                    // usually indicates an IOException as the service is unable to connect
                    CatalogPlugin.trace("trouble connecting to " + service.getID(), t);
                }
            }
            monitor3.done();
        } finally {
            monitor.done();
        }
        return prioritise(availableServices, monitor); //return a prioritise list
    }
View Full Code Here

        int numberOfAvailableInfoFields = 0;

        AbstractGridCoverage2DReader reader = null;

        try {
            IProgressMonitor monitor = new NullProgressMonitor();
            monitor.setTaskName("Checking availability of metadata for " + service.getTitle());
           
            reader = service.getReader(monitor);

            CoordinateReferenceSystem CRS = reader.getCrs();
View Full Code Here

              // Use the extension point information as a quick sanity check to ensure
              // the factory is relevant to the problem at hand
              IResolveAdapterFactory factory = getResolveAdapterFactory( entry );
              if( factory.canAdapt( resolve, adapter)){
                // we think we can do this one...
                IProgressMonitor subMonitor = SubMonitor.convert(monitor, factory.getClass().getCanonicalName(), 10 );
              Object value = factory.adapt( resolve, adapter, subMonitor );
              if( value != null ){
                return adapter.cast( value );
              }
              }
              else {
                monitor.worked(10);
              }
            }
            else {
              monitor.worked(10);
            }
          }
          catch( RuntimeException ignore ){
            // problem encountered with entry; depending
            // on the problem we may consider disabling the entry
            // and logging a warning?
            CatalogPlugin.log( ignore.getLocalizedMessage(), ignore );
          }
        }
       
        // Go through registered factories second, ensuring that
        // XML can always override something that has been hard coded
        //
        for( IResolveAdapterFactory factory : registeredFactories ) {
          try {
            Set<Class<?>> ignoreSet = exceptions.get(factory);
            if( ignoreSet != null && ignoreSet.contains(adapter) ){
              monitor.worked(10);
              continue; // skip this as it is listed as an exception
            }
            if( factory.canAdapt( resolve, adapter)){
              // we think we can do this one...
              IProgressMonitor subMonitor = SubMonitor.convert(monitor, factory.getClass().getCanonicalName(), 10 );
            Object value = factory.adapt( resolve, adapter, subMonitor );
            if( value != null ){
              return adapter.cast( value );
            }
            }
View Full Code Here

               
                boolean foundGoodAction=false;
                for( Iterator<DropActionRunnable> iterator = next.iterator(); iterator.hasNext() && !foundGoodAction; ) {
                    DropActionRunnable action =  iterator.next();
                    IProgressMonitor monitor=new ProgressMonitorTaskNamer(monitor2, 10);
                   
                    monitor2.setTaskName(Messages.UDIGDropHandler_performing_task + ": "+ action.action.getName()); //$NON-NLS-1$
                   
                    // run the next job
                    if( action.run(monitor).getCode()==Status.OK ){
View Full Code Here

        browser.addOpenWindowListener(getChangeListener());
        browser.addTitleListener(getChangeListener());
        item.setControl(browser);
        tabMap.put(browser, item);
       
        final IProgressMonitor monitor = getViewSite().getActionBars().getStatusLineManager().getProgressMonitor();


        browser.addProgressListener(new BrowserProgressListener(monitor, item, tabFolder));

        return browser;
View Full Code Here

    String geomAttName = feature.getFeatureType().getGeometryDescriptor().getLocalName();
    PropertyName geomPropertyExpression = filterFactory.property(geomAttName);
    Literal literalGeomExpression = filterFactory.literal(feature.getDefaultGeometry());
    Touches filter = filterFactory.touches(geomPropertyExpression, literalGeomExpression);
   
    IProgressMonitor monitor =
      getContext().getActionBars().getStatusLineManager().getProgressMonitor();
    FeatureSource<SimpleFeatureType,SimpleFeature> resource =
      getContext().getSelectedLayer().getResource(FeatureSource.class, monitor);
   
    return resource.getFeatures(filter).features();
View Full Code Here

    };
  }
 
  static public IProgressMonitor progress(final org.opengis.util.ProgressListener monitor) {
        if( monitor == null ) return null;
        return new IProgressMonitor(){
            int total;
            int amount;
            public void beginTask( String name, int totalWork ) {
                amount = 0;
                total = totalWork;
View Full Code Here

        };
    }
 
    static public IProgressMonitor progress(final ProgressListener monitor) {
        if( monitor == null ) return null;
        return new IProgressMonitor(){
            int total;
            int amount;
      public void beginTask( String name, int totalWork ) {
                amount = 0;
                total = totalWork;
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.