Examples of buildFeatureType()


Examples of org.geotools.feature.simple.SimpleFeatureTypeBuilder.buildFeatureType()

            public void focusLost( FocusEvent e ) {
                SimpleFeatureType ft = (SimpleFeatureType) viewer.getInput();
                SimpleFeatureTypeBuilder ftB = new SimpleFeatureTypeBuilder();
                ftB.init(ft);
                ftB.setName(nameText.getText());
                featureType = ftB.buildFeatureType();
                viewer.setInput(featureType);
            }

        }
View Full Code Here

Examples of org.geotools.feature.simple.SimpleFeatureTypeBuilder.buildFeatureType()

            if (index == ft.getAttributeCount())
                return;
            SimpleFeatureTypeBuilder builder = builderFromFeatureType(ft);
            builder.remove(ft.getDescriptor(index).getLocalName());
            builder.add(index, newAttr);
            featureType = builder.buildFeatureType();
            viewer.setInput(featureType);
        }

        private AttributeDescriptor createNewAttributeType( AttributeDescriptor editElement, String property,
                Object value ) {
View Full Code Here

Examples of org.geotools.feature.simple.SimpleFeatureTypeBuilder.buildFeatureType()

    }

  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;
  }

    @Ignore
View Full Code Here

Examples of org.geotools.feature.simple.SimpleFeatureTypeBuilder.buildFeatureType()

    @Test
    public void testSetFeatureType() throws Exception {
        editor.setFeatureType(null);

        SimpleFeatureTypeBuilder builder = (SimpleFeatureTypeBuilder) editor.testingGetViewer().getInput();
        assertEquals(2, builder.buildFeatureType().getAttributeCount());
        assertEquals(Messages.FeatureTypeEditor_newFeatureTypeName, builder.getName());
        assertEquals(String.class, getAttributeDescriptor(0).getType().getBinding());
        assertEquals(Messages.FeatureTypeEditor_defaultNameAttributeName, getAttributeDescriptor(0).getName());
        assertEquals(LineString.class, getAttributeDescriptor(1).getType().getBinding());
        assertEquals(Messages.FeatureTypeEditor_defaultGeometryName, getAttributeDescriptor(1).getName());
View Full Code Here

Examples of org.geotools.feature.simple.SimpleFeatureTypeBuilder.buildFeatureType()

        TreeViewer viewer = editor.testingGetViewer();
        viewer.setSelection(new StructuredSelection(featureType.getDescriptor(0)));
        action.runWithEvent(new Event());

        SimpleFeatureTypeBuilder builder = (SimpleFeatureTypeBuilder) editor.testingGetViewer().getInput();
        assertEquals(1, builder.buildFeatureType().getAttributeCount());
        assertEquals(String.class, builder.buildFeatureType().getDescriptor(0).getType().getBinding());
        assertEquals("name", builder.buildFeatureType().getDescriptor(0).getName()); //$NON-NLS-1$

        IAction create = editor.getCreateAttributeAction();
        create.runWithEvent(new Event());
View Full Code Here

Examples of org.geotools.feature.simple.SimpleFeatureTypeBuilder.buildFeatureType()

        viewer.setSelection(new StructuredSelection(featureType.getDescriptor(0)));
        action.runWithEvent(new Event());

        SimpleFeatureTypeBuilder builder = (SimpleFeatureTypeBuilder) editor.testingGetViewer().getInput();
        assertEquals(1, builder.buildFeatureType().getAttributeCount());
        assertEquals(String.class, builder.buildFeatureType().getDescriptor(0).getType().getBinding());
        assertEquals("name", builder.buildFeatureType().getDescriptor(0).getName()); //$NON-NLS-1$

        IAction create = editor.getCreateAttributeAction();
        create.runWithEvent(new Event());
        create.runWithEvent(new Event());
View Full Code Here

Examples of org.geotools.feature.simple.SimpleFeatureTypeBuilder.buildFeatureType()

        action.runWithEvent(new Event());

        SimpleFeatureTypeBuilder builder = (SimpleFeatureTypeBuilder) editor.testingGetViewer().getInput();
        assertEquals(1, builder.buildFeatureType().getAttributeCount());
        assertEquals(String.class, builder.buildFeatureType().getDescriptor(0).getType().getBinding());
        assertEquals("name", builder.buildFeatureType().getDescriptor(0).getName()); //$NON-NLS-1$

        IAction create = editor.getCreateAttributeAction();
        create.runWithEvent(new Event());
        create.runWithEvent(new Event());
View Full Code Here

Examples of org.geotools.feature.simple.SimpleFeatureTypeBuilder.buildFeatureType()

        IAction create = editor.getCreateAttributeAction();
        create.runWithEvent(new Event());
        create.runWithEvent(new Event());

        assertEquals(3, builder.buildFeatureType().getAttributeCount());

        List<AttributeDescriptor> attrs = new ArrayList<AttributeDescriptor>(2);
        attrs.add(builder.buildFeatureType().getDescriptor(1));
        attrs.add(builder.buildFeatureType().getDescriptor(2));
        viewer.setSelection(new StructuredSelection(attrs));
View Full Code Here

Examples of org.geotools.feature.simple.SimpleFeatureTypeBuilder.buildFeatureType()

        create.runWithEvent(new Event());

        assertEquals(3, builder.buildFeatureType().getAttributeCount());

        List<AttributeDescriptor> attrs = new ArrayList<AttributeDescriptor>(2);
        attrs.add(builder.buildFeatureType().getDescriptor(1));
        attrs.add(builder.buildFeatureType().getDescriptor(2));
        viewer.setSelection(new StructuredSelection(attrs));

        action.runWithEvent(new Event());
View Full Code Here

Examples of org.geotools.feature.simple.SimpleFeatureTypeBuilder.buildFeatureType()

        assertEquals(3, builder.buildFeatureType().getAttributeCount());

        List<AttributeDescriptor> attrs = new ArrayList<AttributeDescriptor>(2);
        attrs.add(builder.buildFeatureType().getDescriptor(1));
        attrs.add(builder.buildFeatureType().getDescriptor(2));
        viewer.setSelection(new StructuredSelection(attrs));

        action.runWithEvent(new Event());

        assertEquals(1, builder.buildFeatureType().getAttributeCount());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.