Package org.locationtech.udig.catalog.document.IDocument

Examples of org.locationtech.udig.catalog.document.IDocument.ContentType


            typeViewer.setContentProvider(ArrayContentProvider.getInstance());
            typeViewer.setLabelProvider(new LabelProvider() {
                @Override
                public String getText(Object element) {
                    if (element instanceof ContentType) {
                        final ContentType type = (ContentType) element;
                        return DocUtils.toCamelCase(type.name());
                    }
                    return super.getText(element);
                }
            });
            typeViewer.setInput(IDocument.ContentType.values());
View Full Code Here


        @Override
        protected Control createContents(Composite parent) {
            final Control control = super.createContents(parent);
           
            if( descriptor.isEmpty() ){
                final ContentType defaultType = ContentType.FILE;
                typeViewer.setSelection(new StructuredSelection(defaultType), true);
                setActionText(defaultType, null);
            } else {
                final String labelStr = descriptor.getLabel();
                if (labelStr != null) {
View Full Code Here

                if( label == null || label.isEmpty() ){
                    label = getLabelFromAttribute();
                }
                String description = descriptionText.getText();
                StructuredSelection selection = (StructuredSelection) typeViewer.getSelection();
                ContentType type = (ContentType) selection.getFirstElement();
                final String actionConfig = actionText.getText();
                descriptor = new HotlinkDescriptor(label, description, attributeName, type, actionConfig);
                super.okPressed();               
            }
           
View Full Code Here

                        Messages.DocumentPropertyPage_errRequired);
                return false;
            }
           
            final StructuredSelection selection = (StructuredSelection) typeViewer.getSelection();
            final ContentType type = (ContentType) selection.getFirstElement();
           
            final String attributeName = attributeViewer.getCombo().getText();
            for (HotlinkDescriptor hotlink : hotlinkList) {
                if (!descriptor.isEmpty() && hotlink.toString().equals(descriptor.toString())) {
                    continue;
                }
                if (attributeName.equals(hotlink.getAttributeName())) {
                    final ContentType currentType = hotlink.getType();
                    if (ContentType.ACTION == currentType && ContentType.ACTION == type) {
                        return true;
                    } else {
                        attributeViewer.getControl().setFocus();
                        MessageDialog.openError(getShell(), Messages.DocumentPropertyPage_title,
View Full Code Here

                return DocUtils.toCamelCase(element.toString());
            }
        });
        type.addSelectionChangedListener( new ISelectionChangedListener() {
            public void selectionChanged(SelectionChangedEvent event) {
                final ContentType newTypeValue = getTypeComboValue();
                if (typeValue != newTypeValue) {
                    typeValue = newTypeValue;
                    if (newTypeValue != null) {
                        validateInfo();
                        refreshBtns();
View Full Code Here

     * @param doc
     * @return icon
     */
    public Image createDocumentImage(IDocument doc) {
        final Type type = doc.getType();
        final ContentType contentType = doc.getContentType();
        File file = null;
        if (ContentType.FILE == contentType) {
            file = (File) doc.getContent();
        }
        return createDocumentImage(type, contentType, file, doc.isTemplate());
View Full Code Here

TOP

Related Classes of org.locationtech.udig.catalog.document.IDocument.ContentType

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.