} else {
opac = 1;
}
Color borderColor = BorderColorComboListener.getBorder(getCombo(COMBO_BORDER_COLOR));
FeatureTypeStyle newFTS = null;
try {
newFTS = StyleGenerator.createFeatureTypeStyle(classifier, (org.opengis.filter.expression.Expression) expr, colors, semanticTypeIdentifier, getSelectedLayer().getSchema().getGeometryDescriptor(), elsemode, opac, null);
applyExistingRulesProperties(newFTS, opac, borderColor);
} catch (IllegalFilterException e) {
newFTS = null;
SLDPlugin.log("sg.createFeatureTypeStyle() failed", e); //$NON-NLS-1$
} catch (NullPointerException e) {
newFTS = null;
SLDPlugin.log("sg.createFeatureTypeStyle() failed", e); //$NON-NLS-1$
}
if (newFTS == null) {
ErrorManager.get().displayError(Messages.StyleEditor_error, Messages.StyleEditor_theme_failure);
return;
} else {
//set the FeatureTypeName to the current layer name
newFTS.featureTypeNames().clear();
newFTS.featureTypeNames().add( new NameImpl( SLDs.GENERIC_FEATURE_TYPENAME ));
//get the style
Style style = getStyle();
//ensure the style has an SLD
if (style == null) throw new RuntimeException("Style is null"); //$NON-NLS-1$