Package org.locationtech.udig.catalog.document

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


                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


                IDocument doc = null;
                if (folder.getSource() instanceof IDocumentSource) {
                    final IDocumentSource resourceDocSource = (IDocumentSource) folder.getSource();
                    doc = resourceDocSource.add(info, monitor);
                } else if (folder.getSource() instanceof IAttachmentSource) {
                    final IAttachmentSource featureDocSource = (IAttachmentSource) folder.getSource();
                    doc = featureDocSource.add(feature, info, monitor);
                }               
               
                addDocumentCallback(doc);
                return Status.OK_STATUS;
View Full Code Here

                    final DocumentInfo info = docDialog.getDocInfo();
                    if (source instanceof IDocumentSource) {
                        final IDocumentSource resourceDocSource = (IDocumentSource) source;
                        isUpdated = resourceDocSource.update(doc, info, monitor);
                    } else if (source instanceof IAttachmentSource) {
                        final IAttachmentSource featureDocSource = (IAttachmentSource) source;
                        isUpdated = featureDocSource.update(feature, doc, info, monitor);
                    }             
                    editDocumentCallback(isUpdated);
                    return Status.OK_STATUS;
                }
            };
View Full Code Here

                                return Status.OK_STATUS;
                            }
                        };
                        removeLayerDocJob.schedule();
                    } else if (source instanceof IAttachmentSource) {
                        final IAttachmentSource featureDocSource = (IAttachmentSource) source;
                        final Job removeFeatureDocJob = new Job(Messages.DocumentView_removeDocProgressMsg){
                            @Override
                            protected IStatus run(IProgressMonitor monitor) {
                                final boolean isRemoved = featureDocSource.remove(feature, doc, monitor);
                                removeDocumentCallback(isRemoved);
                                return Status.OK_STATUS;
                            }
                        };
                        removeFeatureDocJob.schedule();
View Full Code Here

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

        if (isValidSource(source)) {
            if (source instanceof IDocumentSource) {
                final IDocumentSource layerDocSource = (IDocumentSource) source;
                return layerDocSource.canAttach();
            } else if (source instanceof IAttachmentSource) {
                final IAttachmentSource featureDocSource = (IAttachmentSource) source;
                return featureDocSource.canAttach();
            }   
        }
        return false;
    }
View Full Code Here

        if (isValidSource(source)) {
            if (source instanceof IDocumentSource) {
                final IDocumentSource layerDocSource = (IDocumentSource) source;
                return layerDocSource.canLinkFile();
            } else if (source instanceof IAttachmentSource) {
                final IAttachmentSource featureDocSource = (IAttachmentSource) source;
                return featureDocSource.canLinkFile();
            }   
        }
        return false;
    }
View Full Code Here

        if (isValidSource(source)) {
            if (source instanceof IDocumentSource) {
                final IDocumentSource layerDocSource = (IDocumentSource) source;
                return layerDocSource.canLinkWeb();
            } else if (source instanceof IAttachmentSource) {
                final IAttachmentSource featureDocSource = (IAttachmentSource) source;
                return featureDocSource.canLinkWeb();
            }   
        }
        return false;
    }
View Full Code Here

        if (isValidSource(source)) {
            if (source instanceof IDocumentSource) {
                final IDocumentSource layerDocSource = (IDocumentSource) source;
                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();
            }   
        }
View Full Code Here

        if (isValidSource(source)) {
            if (source instanceof IDocumentSource) {
                final IDocumentSource layerDocSource = (IDocumentSource) source;
                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();
            }   
        }
View Full Code Here

TOP

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

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.