= resource.resolve(SimpleFeatureSource.class, m);
if (featureSource != null) {
//match up the feature type style name and the feature type name
SimpleFeatureType type = featureSource.getSchema();
FeatureTypeStyle fstyle = SLDs.featureTypeStyle(style,type);
if (fstyle == null) {
//force a name match
List<FeatureTypeStyle> fstyles = style.featureTypeStyles();
if (fstyles != null && !fstyles.isEmpty()) {
fstyle = fstyles.get(0);
}
}
if (fstyle != null) {
fstyle.setName(type.getName().getLocalPart());
StyleBlackboard styleBlackboard = (StyleBlackboard) layer.getStyleBlackboard();
styleBlackboard.put(SLDContent.ID, style);
styleBlackboard.setSelected(new String[]{SLDContent.ID});
// //force a rerender, TODO: blackboard events