Examples of ICatalog


Examples of org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalog

    String result = null;
    INextCatalog[] nextCatalogs = getNextCatalogs();
    for (int i = 0; i < nextCatalogs.length; i++)
    {
      INextCatalog nextCatalog = nextCatalogs[i];
      ICatalog catalog = nextCatalog.getReferencedCatalog();
      if (catalog != null)
      {
        switch (entryType)
        {
        case ICatalogEntry.ENTRY_TYPE_PUBLIC:
          result = catalog.resolvePublic(publicId, systemId);
          break;
        case ICatalogEntry.ENTRY_TYPE_SYSTEM:
          result = catalog.resolveSystem(systemId);
          break;
        case ICatalogEntry.ENTRY_TYPE_URI:
          result = catalog.resolveURI(systemId);
          break;
        default:
          break;
        }
        if (result != null)
View Full Code Here

Examples of org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalog

          .hasNext();) {
        IDelegateCatalog delegate = (IDelegateCatalog) iterator.next();
       
        if (key.startsWith(delegate.getStartString())) {
 
          ICatalog catalog = delegate.getReferencedCatalog();
          if (catalog != null)
          {
            switch (delegate.getEntryType())
            {
            case IDelegateCatalog.DELEGATE_TYPE_PUBLIC:
              result = catalog.resolvePublic(key, systemId);
              break;
            case IDelegateCatalog.DELEGATE_TYPE_SYSTEM:
              result = catalog.resolveSystem(systemId);
              break;
            case IDelegateCatalog.DELEGATE_TYPE_URI:
              result = catalog.resolveURI(systemId);
              break;
            default:
              break;
            }
            if (result != null)
View Full Code Here

Examples of org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalog

      }
      else if (parentElement == roots[1]) {
        result = getChildrenHelper(fSystemCatalog);
      }
      else if (parentElement instanceof INextCatalog) {
        ICatalog nextCatalog = ((INextCatalog) parentElement).getReferencedCatalog();
        result = getChildrenHelper(nextCatalog);
      }
      else if (parentElement instanceof IDelegateCatalog) {
        ICatalog nextCatalog = ((IDelegateCatalog) parentElement).getReferencedCatalog();
        result = getChildrenHelper(nextCatalog);
      }
      return result;
    }
View Full Code Here

Examples of org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalog

  public XMLCatalogPreferencePage() {
    defaultCatalog = XMLCorePlugin.getDefault().getDefaultXMLCatalog();
    INextCatalog[] nextCatalogs = defaultCatalog.getNextCatalogs();
    for (int i = 0; i < nextCatalogs.length; i++) {
      INextCatalog catalog = nextCatalogs[i];
      ICatalog referencedCatalog = catalog.getReferencedCatalog();
      if (referencedCatalog != null) {
        if (XMLCorePlugin.SYSTEM_CATALOG_ID.equals(referencedCatalog.getId())) {
          systemCatalog = referencedCatalog;
        }
        else if (XMLCorePlugin.USER_CATALOG_ID.equals(referencedCatalog.getId())) {
          userCatalog = referencedCatalog;
        }
      }
    }
  }
View Full Code Here

Examples of org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalog

      IFile file = dialog.getFile();
      if (file != null) {
        String fileName = file.getLocation().toFile().toURI().toString();
        try {
          CatalogSet tempResourceSet = new CatalogSet();
          ICatalog newCatalog = tempResourceSet.lookupOrCreateCatalog("temp", fileName); //$NON-NLS-1$
          workingUserCatalog.addEntriesFromCatalog(newCatalog);
        }
        catch (Exception e) {
          // TODO... give error message
        }
View Full Code Here

Examples of org.locationtech.udig.catalog.ICatalog

        progressMonitor.beginTask("task", 6); //$NON-NLS-1$
        progressMonitor.worked(1);

        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.locationtech.udig.catalog.ICatalog

  boolean done;
 
  @Before
  public void setUp() throws Exception {
    //get a georesource
    ICatalog catalog = CatalogPlugin.getDefault().getLocalCatalog();
    IServiceFactory sFactory
      = CatalogPlugin.getDefault().getServiceFactory();
   
    HashMap params = new HashMap();
    params.put("dummy", DummyService.url);
View Full Code Here

Examples of org.locationtech.udig.catalog.ICatalog

       
        //ensure the right type of service was created
        IService service = services.get(0);
        assertNotNull( service );
       
        ICatalog catalog = CatalogPlugin.getDefault().getLocalCatalog();
        catalog.add( service ); // we can now find this service!
       
        List<IResolve> found = catalog.search("csv",null, null );
        assertEquals( 2, found.size() );
       
        //get all the resources from the service
        List<? extends IGeoResource> resources = service.resources(null);
        assertNotNull(resources);
View Full Code Here

Examples of org.locationtech.udig.catalog.ICatalog

     * @param location represents the location the mapgraphic will sit on the map   *
   */
  private static Layer createWhitebox(Map map, Rectangle location) {
      try {

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

            LayerFactory layerFactory = map.getLayerFactory();
            URL resourceID = new URL(null, "mapgraphic://localhost/mapgraphic#org.locationtech.udig.tutorial.mapgraphic.Whitebox", CorePlugin.RELAXED_HANDLER); //$NON-NLS-1$
            ID id = new ID(resourceID);
            IGeoResource resource = localCatalog.getById(IGeoResource.class, id, new NullProgressMonitor());
            Layer whiteboxLayer = layerFactory.createLayer(resource);
           
            whiteboxLayer.getStyleBlackboard().put(LocationStyleContent.ID, location);
            return whiteboxLayer;
      }
View Full Code Here

Examples of org.locationtech.udig.catalog.ICatalog

     * @param location represents the location the mapgraphic will sit on the map
     */
    protected static Layer createTitleArea(Map map, Rectangle location, IProgressMonitor monitor) {
        try {

            ICatalog localCatalog = CatalogPlugin.getDefault().getLocalCatalog();
            List<Layer> layersInternal = map.getLayersInternal();
            LayerFactory layerFactory = map.getLayerFactory();
           
            Iterator layerIterator = layersInternal.iterator();
            Layer farmParcelLayer = null;
            while (layerIterator.hasNext()) {
                Layer layer = (Layer)layerIterator.next();
                if (layer.getName().equals("SDE.DATE_PRIMARE")) {
                    farmParcelLayer = layer;
                }
            }
           
            if (farmParcelLayer == null) {
                throw new IllegalStateException("cannot find farm layer");
            }
           

            //get title from selected feature of farm layer           
            Filter farmParcelFilter = farmParcelLayer.getFilter();
            Query query = new DefaultQuery(farmParcelLayer.getSchema().getTypeName(),
                                           farmParcelFilter,
                                           new String[0]  ); //{"nume_com", "fbid"}
           
             FeatureSource<SimpleFeatureType, SimpleFeature> featureSource =
                farmParcelLayer.getResource(FeatureSource.class,
                                            new SubProgressMonitor(monitor, 1));
            FeatureCollection<SimpleFeatureType, SimpleFeature>  features = featureSource.getFeatures(query);
            FeatureIterator<SimpleFeature> featureIterator = features.features();
            if (!featureIterator.hasNext()) {
                throw new IllegalStateException("At least one feature must be selected in the farm layer. "+features.size()+ " found.");
            }
            SimpleFeature selectedFarmFeature = featureIterator.next();
            String prov = (String)selectedFarmFeature.getAttribute(0);
            String id = (String)selectedFarmFeature.getAttribute(1);
           
            //put layer info on the mapgraphic's style blackboard
            URL detailsResId = new URL(null, "mapgraphic://localhost/mapgraphic#org.locationtech.udig.tutorial.mapgraphic.TitleArea", CorePlugin.RELAXED_HANDLER);
            IGeoResource detailsRes = localCatalog.getById(IGeoResource.class, new ID(detailsResId), new NullProgressMonitor());
            
            Layer titleAreaLayer = layerFactory.createLayer(detailsRes);
            titleAreaLayer.getStyleBlackboard().put(LocationStyleContent.ID, location);
            XMLMemento selectedFeatureMemento = XMLMemento.createWriteRoot("style");
            selectedFeatureMemento.putString(FEATURE_ID_KEY, id);
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.