Package org.opengis.feature.type

Examples of org.opengis.feature.type.AttributeDescriptor


        public void modify( Object element, String property, Object value ) {
            if( element==null || property==null || value==null ){
                return;
            }
           
            AttributeDescriptor editElement = (AttributeDescriptor) ((TreeItem) element).getData();
            SimpleFeatureType ft = (SimpleFeatureType) viewer.getInput();
            AttributeDescriptor newAttr = createNewAttributeType(editElement, property, value );
           
            if (newAttr == null)
                return;
            int index = 0;
            for( ; index < ft.getAttributeCount(); index++ ) {
View Full Code Here


        ICellModifier cellModifier = testingGetViewer.getCellModifier();

        cellModifier.modify(testingGetViewer.getTree().getItem(0), "0", "the_new_name"); //$NON-NLS-1$//$NON-NLS-2$

        AttributeDescriptor attributeType = getAttributeDescriptor(0);
        assertEquals("the_new_name", attributeType.getName()); //$NON-NLS-1$

        for( int i = 0; i < FeatureTypeEditor.testingGetTYPES().size(); i++ ) {
            cellModifier.modify(testingGetViewer.getTree().getItem(0), "1", i); //$NON-NLS-1$.
            attributeType = getAttributeDescriptor(0);
            assertEquals(FeatureTypeEditor.testingGetTYPES().get(i).getType(), attributeType
                    .getType());
        }
    }
View Full Code Here

  private AttributeDescriptor getAttributeDescriptor(int index) {
        TreeViewer testingGetViewer = editor.testingGetViewer();
    SimpleFeatureTypeBuilder newFeatureTypeBuilder = (SimpleFeatureTypeBuilder) testingGetViewer.getInput();
        SimpleFeatureType type = newFeatureTypeBuilder.buildFeatureType();
        AttributeDescriptor attributeType = type.getDescriptor(index);
    return attributeType;
  }
View Full Code Here

    protected boolean doCheckState() {
        EditFeature feature = getFeature();
        if (feature == null)
            return true; // cannot check right now
        SimpleFeatureType schema = feature.getFeatureType();
        AttributeDescriptor descriptor = schema.getDescriptor(getAttributeName());
        if (descriptor == null) {
            // the schema changed on us! help ...
            return false;
        }
        String text = textField.getText();

        if (text == null || text.length() == 0) {
            return !descriptor.isNillable();
        }
        Object value = Converters.convert(text, descriptor.getType().getBinding());
        try {
            Types.validate(descriptor, value);
            if( isRequired() && value == null ){
                errorMessage = getAttributeName() + " is required";
                showErrorMessage(errorMessage);
View Full Code Here

     * (non-Javadoc) Method declared on AttributeField.
     */
    protected void doLoadDefault() {
        if (textField != null) {
            SimpleFeatureType schema = getFeature().getFeatureType();
            AttributeDescriptor descriptor = schema.getDescriptor(getAttributeName());
            Object value = descriptor.getDefaultValue();

            String text = Converters.convert(value, String.class);
            textField.setText(text);
        }
        valueChanged();
View Full Code Here

    /*
     * (non-Javadoc) Method declared on AttributeField.
     */
    protected void doStore() {
        SimpleFeatureType schema = getFeature().getFeatureType();
        AttributeDescriptor descriptor = schema.getDescriptor(getAttributeName());

        String text = textField.getText();
        Object value = Converters.convert(text, descriptor.getType().getBinding());
        getFeature().setAttribute(getAttributeName(), value);
    }
View Full Code Here

        SimpleFeatureStore featureStore = resource.resolve(SimpleFeatureStore.class,
                new NullProgressMonitor());
        SimpleFeatureType schema = featureStore.getSchema();
        for (HotlinkDescriptor hotlinkDescriptor : list) {
            AttributeDescriptor attributeDescriptor = schema.getDescriptor(hotlinkDescriptor
                    .getAttributeName());
            assertNotNull("confirm attribute name matches", attributeDescriptor);
            assertTrue("Confirm String",
                    String.class.isAssignableFrom(attributeDescriptor.getType().getBinding()));

            assertNotNull(hotlinkDescriptor.getType() != null);
        }
        FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2();
        SimpleFeatureCollection features = featureStore.getFeatures(ff.equals(ff.property("STATE"),
View Full Code Here

     */
    protected void doLoadDefault() {
        if (list != null) {
            list.removeAll();
            SimpleFeatureType schema = getFeature().getFeatureType();
            AttributeDescriptor descriptor = schema.getDescriptor( getAttributeName());           
            Object value = descriptor.getDefaultValue();
            String text = Converters.convert(value, String.class );
            String[] array = parseString(text);
            for (int i = 0; i < array.length; i++) {
                list.add(array[i]);
            }
View Full Code Here

            IStructuredSelection sel = (IStructuredSelection) selection;
            Object value = sel.getFirstElement();
            getFeature().setAttribute(getAttributeName(), value);
        } else {
            SimpleFeatureType schema = getFeature().getFeatureType();
            AttributeDescriptor descriptor = schema.getDescriptor( getAttributeName())
           
            String text = viewer.getCombo().getText();
            Object value = Converters.convert( text, descriptor.getType().getBinding() );       
            getFeature().setAttribute( getAttributeName(), value );
        }

    }
View Full Code Here

        if( feature == null ){
            return false; // cannot check right now
        }
       
        SimpleFeatureType schema = feature.getFeatureType();
        AttributeDescriptor descriptor = schema.getDescriptor( getAttributeName());
        if( descriptor == null ){
            return false; // schema changed on us?
        }
        Class<?> binding = descriptor.getType().getBinding();
       
        Object value = Converters.convert( date, binding );
        try {
            Types.validate( descriptor, value );
            return true;
View Full Code Here

TOP

Related Classes of org.opengis.feature.type.AttributeDescriptor

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.