Package org.locationtech.udig.catalog

Examples of org.locationtech.udig.catalog.IResolve


                }
                return new TreeSelection(paths.toArray(new TreePath[paths.size()]));
            }

            private List<IResolve> toTreePath( IGeoResource resource ) {
                IResolve parent;
                try {
                    parent = resource.parent(ProgressManager.instance().get());
                } catch (IOException e) {
                    CatalogUIPlugin.log("Error resolving the parent", e); //$NON-NLS-1$
                    parent = null;
View Full Code Here


    public Image decorateImage( Image image, Object element ) {
       if( disposed ) return null;
        if (!(element instanceof IResolve))
            return null;

        IResolve resolve = (IResolve) element;
       
        if (images.containsKey(element)) {
            LabelData data = images.get(element);
            // if data is null then it is being loaded already so return
            if (data == null)
                return null;
        }

        // look image up in registry to see if it is already loaded
        ImageRegistry imageRegistry = CatalogUIPlugin.getDefault().getImageRegistry();
        Image i;
        synchronized (imageRegistry) {
            i = imageRegistry.get(resolve.getIdentifier().toString());
            // if it is loaded and not disposed then we're good, return it.
            if( i!=null && !i.isDisposed()){
                return i;
            }
           
            if (i!=null && i.isDisposed() )
                imageRegistry.remove(resolve.getIdentifier().toString());
        }
       
        // we tried to look up a cached version... If not around and viewer doesn't want decorated images then we'll return.
       
        if( !resolve.getID().isLocal() && !decorateImages ){
            return null;
        }
       
        // put an element in the map so that it will not be loaded again.
        images.put(resolve, null);
View Full Code Here

        if( disposed ) return null;
        if (!(element instanceof IResolve)){
            return null;
        }

        IResolve resolve = (IResolve) element;
       
        if (decorated.containsKey(element)) {
            LabelData data = decorated.get(element);
            if (data == null){
                return null;
            }
            if( resolve instanceof IService ){
                if( resolve.getID().getTypeQualifier() != null ){
                    return data.text + " ("+resolve.getID().getTypeQualifier() +")";
                }
            }
            return data.text;           
        }

        decorated.put(resolve, null);
        if (resolve.getTitle() != null) {
            LabelData data = new LabelData();
            data.text = resolve.getTitle();
            decorated.put(resolve, data);      
            if( resolve instanceof IService ){
                if( resolve.getID().getTypeQualifier() != null ){
                    return data.text + " ("+resolve.getID().getTypeQualifier() +")";
                }
            }
            return data.text;           
        }
        toDecorate.offer(resolve);
View Full Code Here

    public Color decorateForeground( Object element ) {
        if( disposed ) return null;
        if (!(element instanceof IResolve))
            return null;

        IResolve resolve = (IResolve) element;
        if (resolve.getStatus() == org.locationtech.udig.catalog.IResolve.Status.BROKEN) {
            return Display.getCurrent().getSystemColor(SWT.COLOR_RED);
        }
        if (resolve.getStatus() == org.locationtech.udig.catalog.IResolve.Status.RESTRICTED_ACCESS) {
            return Display.getCurrent().getSystemColor(SWT.COLOR_DARK_YELLOW);
        }
        return null;
    }
View Full Code Here

   
    public Font decorateFont( Object element ) {
        if (!(element instanceof IResolve))
            return null;

        IResolve resolve = (IResolve) element;
        if (resolve.getStatus() == org.locationtech.udig.catalog.IResolve.Status.BROKEN
                || resolve.getStatus() == org.locationtech.udig.catalog.IResolve.Status.RESTRICTED_ACCESS) {
            return getBrokenFont();
        }
        return null;
    }
View Full Code Here

        return canAccept(data);
    }

    private boolean canAccept( Object data ) {
        if (data instanceof IResolve) {
            IResolve resolve = (IResolve) data;
            List<IResolve> find = CatalogPlugin.getDefault().getLocalCatalog().find(
                    resolve.getIdentifier(), new NullProgressMonitor());
            if (find != null && !find.isEmpty())
                return false;

            return canImport(data);
        }
View Full Code Here

        public IStatus run( final IProgressMonitor monitor ) {
            updater=new DisplayUpdater(monitor);
            try{
                while( true ) {
                    final IResolve element = toDecorate.poll();
                    if(element == null) break;
                    // check if some how request has already been fullfilled.
                    LabelData labelData = decorated.get(element);
                    if (text && labelData != null)
                        continue;
                    if (!text && labelData!=null)
                        continue;
                   
                    URL identifier = element.getIdentifier();
                    monitor.beginTask(Messages.ResolveTitlesDecorator_0 + identifier.getFile(),
                            IProgressMonitor.UNKNOWN);
                    if( monitor.isCanceled() ){
                        return Status.OK_STATUS;
                    }
View Full Code Here

                                    JGrassMapGeoResource.class, null)).getType().equals(JGrassConstants.ESRIRASTERMAP)))

                    {
                        JGrassMapGeoResource mapResolve = layer.getGeoResource().resolve(JGrassMapGeoResource.class,
                                new NullProgressMonitor());
                        IResolve mapsetResolve = mapResolve.parent(new NullProgressMonitor());
                        // check for the limiting mapset
                        if (mapsetPath != null && mapsetResolve instanceof JGrassMapsetGeoResource) {
                            JGrassMapsetGeoResource map = (JGrassMapsetGeoResource) mapsetResolve;
                            File refFile = map.getFile();
                            File mapsetFile = new File(mapsetPath);
View Full Code Here

                Map<String, Serializable> params = DataStoreServiceExtension
                        .createDataAcessParameters(url);
                return params;
            }
            if (context instanceof IResolve) {
                IResolve resolve = (IResolve) context;
                ID id = resolve.getID();
                URL url = id.toURL();

                Map<String, Serializable> params = DataStoreServiceExtension
                        .createDataAcessParameters(url);
                return params;
View Full Code Here

                Map<String, Serializable> params = DataStoreServiceExtension
                        .createDataAcessParameters(url);
                return params != null ? url : null;
            }
            if (context instanceof IResolve) {
                IResolve resolve = (IResolve) context;
                ID id = resolve.getID();
                URL url = id.toURL();

                Map<String, Serializable> params = DataStoreServiceExtension
                        .createDataAcessParameters(url);
View Full Code Here

TOP

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

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.