Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[udig-devel] To use ChoiceAttributeType with geotools

Hello

I'm working with UDIG 1.1.M5 and geotools.
I want to add a attribute to one feature when I create it. For that attribute I want the user to be able to change its value from a list of predetermined  values in the feature editor.
I don't know if I am using the right class (ChoiceAttributeType), but I'm not achieving my goal because although the feature editor shows the property, it is not possible to change it nor to chose between the different values.

The type of geometry is a polygon, but I will have point and polylines.

	--------------------------------------------------
	chAttribute[0] = AttributeTypeFactory.newAttributeType("A",String.class);
	chAttribute[1] = AttributeTypeFactory.newAttributeType("B",String.class);
	ChoiceAttributeType choiceAttribute = new ChoiceAttributeType("TYPE",chAttribute);

	...........

	Object[] featureAttributes = {geometry,"A"};
	features[i] = FeatureType.create(featureAttributes, 1);

	-------------------------------------------------

Has someone tried to do the same thing?  

A greeting





Back to the top