Examples of SubProgressMonitor


Examples of org.eclipse.core.runtime.SubProgressMonitor

        try {

            ICatalog catalog = CatalogPlugin.getDefault().getLocalCatalog();

            // first search the local catalog.
            List<IResolve> matches = catalog.find(url, new SubProgressMonitor(progressMonitor, 2));

            for (IResolve resolve : matches) {
                if (resolve instanceof ExpectedService) {
                    // found the resource now we have to search it for the
                    // resource we want
                    if (searchServiceForResource(new SubProgressMonitor(progressMonitor, 2), addPosition, map,
                            (IService) resolve))
                        return;
                } else if (resolve instanceof ExpectedGeoResource) {
                    // yay we found the resource this is too easy:)

                    ApplicationGIS.addLayersToMap(map, Collections.singletonList((IGeoResource) resolve), addPosition);
                    return;
                }
            }

            // usually only returns 1 service but it may be that multiple
            // Services know how to interpret the URL
            List<IService> services = CatalogPlugin.getDefault().getServiceFactory().createService(url);
            IService found = null;
            progressMonitor.worked(1);

            // find the service you want
            for (IService service : services) {
                // determine if the service is the type you are expecting;
                if (service instanceof ExpectedService) {
                    found = service;
                    break;
                }
            }

            catalog.add(found);
            searchServiceForResource(new SubProgressMonitor(progressMonitor, 2), addPosition, map, found);

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

Examples of org.nightlabs.progress.SubProgressMonitor

      QueryCollection<AbstractJDOQuery> queryCollection = new QueryCollection<AbstractJDOQuery>(Offer.class);
      OfferQuery offerQuery = new OfferQuery();
      offerQuery.setReserved(true);
      offerQuery.setProductTypeID(productTypeID);
      queryCollection.add(offerQuery);
      return getOffersByQuery(queryCollection, fetchGroups, maxFetchDepth, new SubProgressMonitor(monitor, 100));
    } catch (Exception e) {
      throw new RuntimeException(e);
    } finally {
      monitor.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.