viewer.setInput(featureType);
}
private AttributeDescriptor createNewAttributeType( AttributeDescriptor editElement, String property,
Object value ) {
AttributeTypeBuilder builder = new AttributeTypeBuilder();
builder.init(editElement);
//builder.setName((String)property);
switch( Integer.parseInt(property) ) {
case NAME_COLUMN:
return builder.buildDescriptor((String)value);
case TYPE_COLUMN:
int choice = -1;
if( value instanceof Integer) {
choice = (Integer) value;
}
else if( value instanceof String) {
choice = Integer.parseInt( (String) value );
}
if (choice == -1)
return null;
else {
Class type = legalTypes.get(choice).getType();
builder.setBinding(type);
return builder.buildDescriptor( editElement.getLocalName());
}
case OTHER_COLUMN:
lastCRS=value;
CoordinateReferenceSystem crs = (CoordinateReferenceSystem) value;
if( FeatureTypeEditor.this.featureType.getGeometryDescriptor()==editElement ){
setDefaultCRS(crs);
}
builder.setCRS(crs);
return builder.buildDescriptor( editElement.getLocalName());
default:
return null;
}
}