if( result ){
try {
StyleLayer layer = getContainer().getSelectedLayer();
IGeoResource resource = layer.findGeoResource(FeatureSource.class);
if( resource!=null ){
style = (Style) new SLDContent().createDefaultStyle(resource, layer.getDefaultColor(), null);
}else{
resource = layer.findGeoResource(GridCoverage.class);
if( resource!=null ){
style = (Style) new SLDContent().createDefaultStyle(resource, layer.getDefaultColor(), null);
}
}
if( style!=null ){
sld = SLDContent.createDefaultStyledLayerDescriptor(style);
setStyle(style);