Package org.locationtech.udig.catalog

Examples of org.locationtech.udig.catalog.ID


        IResolve hit = event.getResolve();

        // Temporary solution while migrating to URI identifiers
        if (delta.getKind() == IResolveDelta.Kind.CHANGED && hit != null) {

            ID affected = hit.getID();
            ID id = getResourceID();
            if (id == null)
                return;

            List<IGeoResource> resources = geoResources;
            for (IGeoResource resource : resources) {
View Full Code Here


        }
        IService service = resource.service(null);
        if( service == null ){
            return null; // cannot determine sevice at this time!
        }
        ID serviceID = service.getID();       
//        if( serviceID.isWFS() ){
//            return true; // we want to cache for WFS
//        }
        if( serviceID.isFile() ){
            String ext = serviceID.toExtension();
            if( ext.toLowerCase().endsWith("jpg") ||
                    ext.toLowerCase().endsWith("jpeg")){
                return true; // we want to cache JPEG
            }
        }
View Full Code Here

        }
        URL url = toCapabilitiesURL( context );
        if( url == null ){
            // so we are not sure it is a postgis url
            // lets guess
            ID sample = ID.cast( context );
            url = sample != null ? sample.toURL() : null;
        }
        if( url != null && PostgisServiceExtension2.isPostGIS(url)) { 
            // well we have a url - lets try it!           
            List<IResolve> list = CatalogPlugin.getDefault().getLocalCatalog().find( url, null );
            for( IResolve resolve : list ){
View Full Code Here

        exportButton.setImage(exportImg);
        exportButton.setToolTipText(Messages.LinePropertiesEditor_23);
        exportButton.addSelectionListener(new SelectionAdapter(){
            public void widgetSelected( SelectionEvent e ) {
                IGeoResource geoResource = layer.getGeoResource();
                ID id = geoResource.getID();
                if (id.isFile()) {
                    try {
                        File file = id.toFile();
                        lineStyleManager.exportStyle(styleWrapper, file);
                    } catch (Exception e1) {
                        e1.printStackTrace();
                    }
                } else {
View Full Code Here

        // to test that a listener is only added once
        prop.addListener(l);
       
        URL id = layer.getID();
        ICatalog localCatalog = CatalogPlugin.getDefault().getLocalCatalog();
        IGeoResource resource = localCatalog.getById(IGeoResource.class, new ID(id), new NullProgressMonitor());
        IService parent = resource.service(new NullProgressMonitor());
        localCatalog.replace(parent.getID(), parent);
       
        assertEquals(0, changed[0]);
       
View Full Code Here

public class MapDecoratorExamples {

    public void lookupExample() {
        IRepository local = CatalogPlugin.getDefault().getLocal();

        final ID GRID_ID = new ID("mapgraphic:///localhost/mapgraphic#grid", null);
        IGeoResource gridResource = local.getById(IGeoResource.class, GRID_ID, new NullProgressMonitor());
        // You can then use this with the AddLayersCommand
    }
View Full Code Here

     * @return properties file
     */
    public File createPropertiesFile() {
        File file = getPropertiesFile();
        if (file == null) {
            final ID fileId = new ID(url);
            file = fileId.toFile(PROP_FILE_EXT);
            try {
                file.createNewFile();
            } catch (IOException e) {
                e.printStackTrace();
            }
View Full Code Here

     * @deprecated Please use new ID( url ).isJDBC()
     * @param url
     * @return true if ID refers to a database (ie is a jdbc url)
     */
    public static final boolean isJDBC( URL url ) {
      return new ID( url ).isJDBC();
//        String PROTOCOL = url.getProtocol();
//        String HOST = url.getHost();
//        return "http".equals(PROTOCOL) && HOST != null && HOST.indexOf(".jdbc") != -1; //$NON-NLS-1$ //$NON-NLS-2$
    }
View Full Code Here

     *
     * @param url
     * @return properties file
     */
    public static File getPropertiesFile(URL url) {
        return getPropertiesFile(new ID(url));
    }
View Full Code Here

    @SuppressWarnings("unchecked")
    @Override
    public final boolean canProcess( Object context ) {
        ServiceExtension2 serviceExtension = getServiceExtension();
        if( context instanceof ID){
            ID id=(ID) context;
            return canProcess(serviceExtension, id);
        }
        if( context instanceof URL){
            URL url=(URL) context;
            return canProcess(serviceExtension, url);
        }
        if( context instanceof String){
           
            // if the string cannot be processed we want to fall through so
            // that doOtherChecks() can be called.
            String string=(String) context;
            try{
                URL url=new URL(string);
                if ( canProcess(serviceExtension, url) )
                    return true;
            }catch (MalformedURLException e) {
                // continue.
            }
        }
        if( context instanceof Map){
            Map map=(Map) context;
            return canProcess(serviceExtension, map);
        }
        if( context instanceof IResolve){
            ID id = ((IResolve)context).getID();
            return canProcess(serviceExtension, id);
        }
        if( CatalogPlugin.locateURL(context)!=null ){
            return canProcess(serviceExtension, CatalogPlugin.locateURL(context));
        }
View Full Code Here

TOP

Related Classes of org.locationtech.udig.catalog.ID

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.