ProgressManager.instance().get());
if (ds == null){
return resource; // not a datastore give up!
}
String typeName = resource.getSchema().getTypeName();
Query query;
if (prop instanceof Filter) {
query = new Query(typeName, (Filter) prop);
} else {
query = (Query) prop;
}
if( !layer.getStyleBlackboard().contains(KEY) ){
layer.getStyleBlackboard().put(KEY, query);
}
if (!typeName.equals(query.getTypeName())) {
query = createQuery(query.getFilter(), query
.getCoordinateSystem(), query
.getCoordinateSystemReproject(), query
.getHandle(), query.getMaxFeatures(), query
.getNamespace(), query.getPropertyNames(),
typeName);
}
// provide our own default view wrapper (will be required in GeoTools 2.7)
SimpleFeatureSource view = new DefaultView((SimpleFeatureSource) resource, query);