Package org.locationtech.udig.catalog.document

Examples of org.locationtech.udig.catalog.document.IHotlinkSource


            if (geoResource != null) {
               
                feature = getFeature(geoResource, toFilter(obj, monitor));
                if (feature != null) {
                   
                    final IHotlinkSource hotlinkSource = toSource(geoResource, IHotlinkSource.class, monitor);
                    isHotlinkEnabled = hotlinkSource != null && hotlinkSource.isEnabled();
                    final IAttachmentSource attachmentSource = toSource(geoResource, IAttachmentSource.class, monitor);
                    isFeatureEnabled = attachmentSource != null && attachmentSource.isEnabled();
                   
                    if (isFeatureEnabled || isHotlinkEnabled) {
                        final String featureLabel = getFeatureLabel(geoResource, feature);
                        final IDocumentFolder folder = ShpDocFactory.createFolder(feature, featureLabel, attachmentSource);
                        if (isFeatureEnabled) {
                            // Set so that source's document list is same with folder's
                            folder.setDocuments(attachmentSource.getDocuments(feature, monitor));   
                        }
                        if (isHotlinkEnabled) {
                            folder.insertDocuments(hotlinkSource.getDocuments(feature, monitor), 0);
                        }
                        items.add(folder);
                    }
                   
                }
View Full Code Here


        if (docDialog != null) {
            final Job editHotlinkJob = new Job(Messages.DocumentView_updateHotlinkProgressMsg){
                @Override
                protected IStatus run(IProgressMonitor monitor) {
                    boolean isUpdated = false;
                    final IHotlinkSource featureDocSource = (IHotlinkSource) doc.getSource();
                    switch (doc.getContentType()) {
                    case FILE:
                        isUpdated = featureDocSource.setFile(feature, attributeName, docDialog.getFileInfo(), monitor);
                        break;
                    case WEB:
                        isUpdated = featureDocSource.setLink(feature, attributeName, docDialog.getUrlInfo(), monitor);
                        break;
                    case ACTION:
                        isUpdated = featureDocSource.setAction(feature, attributeName, docDialog.getInfo(), monitor);
                        break;
                    default:
                        break;
                    }
                    if (isUpdated) {
View Full Code Here

                                return Status.OK_STATUS;
                            }
                        };
                        removeFeatureDocJob.schedule();
                    } else if (source instanceof IHotlinkSource) {
                        final IHotlinkSource featureHotlinkSource = (IHotlinkSource) source;
                        final Job clearHotlinkJob = new Job(Messages.DocumentView_clearHotlinkProgressMsg) {
                            @Override
                            protected IStatus run(IProgressMonitor monitor) {
                                final IHotlink hotlinkDoc = (IHotlink) doc;
                                final String attributeName = hotlinkDoc.getAttributeName();
                                boolean isCleared = featureHotlinkSource.clear(feature,
                                        attributeName, monitor);
                                if (isCleared) {
                                    isCleared = set(attributeName, null, monitor);
                                }
                                clearHotlinkCallback(isCleared);
View Full Code Here

                if (documentSource != null) {
                    return adapter.cast(documentSource);
                }
            }
            if (adapter.isAssignableFrom(IHotlinkSource.class)) {
                IHotlinkSource hotlink = new ShpHotlinkSource(shpGeoResource);
                if (hotlink != null) {
                    return adapter.cast(hotlink);
                }
            }
            if (adapter.isAssignableFrom(IAttachmentSource.class)) {
View Full Code Here

                return layerDocSource.canUpdate();
            } else if (source instanceof IAttachmentSource) {
                final IAttachmentSource featureDocSource = (IAttachmentSource) source;
                return featureDocSource.canUpdate();
            } else if (source instanceof IHotlinkSource) {
                final IHotlinkSource hotlinkSource = (IHotlinkSource) source;
                return hotlinkSource.canSetHotlink();
            }   
        }
        return false;
    }
View Full Code Here

                return layerDocSource.canRemove();
            } else if (source instanceof IAttachmentSource) {
                final IAttachmentSource featureDocSource = (IAttachmentSource) source;
                return featureDocSource.canRemove();
            } else if (source instanceof IHotlinkSource) {
                final IHotlinkSource hotlinkSource = (IHotlinkSource) source;
                return hotlinkSource.canClearHotlink();
            }   
        }
        return false;
    }
View Full Code Here

        featureHotlinksFlag.setSelection(false);
        featureHotlinksFlag.setEnabled(false);
        setTableAndButtonsEnablements(false);
        if (resource.canResolve(IHotlinkSource.class)) {
            try {
                final IHotlinkSource source = resource.resolve(IHotlinkSource.class, monitor);
                final boolean isEnabled = source.isEnabled();
                final boolean isEditable = source.isEnabledEditable();
                featureHotlinksFlag.setSelection(isEnabled);
                featureHotlinksFlag.setEnabled(isEditable);
                setTableAndButtonsEnablements(isEnabled && isEditable);
                if (isEditable) {
                    hotlinkList = new ArrayList<HotlinkDescriptor>();
View Full Code Here

    public <T> T adapt(IResolve resolve, Class<T> adapter, IProgressMonitor monitor)
            throws IOException {
        if (resolve instanceof IGeoResource) {
            final IGeoResource resource = (IGeoResource) resolve;
            if (adapter.isAssignableFrom(IHotlinkSource.class)) {
                final IHotlinkSource source = new BasicHotlinkSource(resource);
                return adapter.cast(source);
            }   
        }
        return null;
    }
View Full Code Here

TOP

Related Classes of org.locationtech.udig.catalog.document.IHotlinkSource

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.