use of org.geotools.filter.function.PropertyExistsFunction in project sldeditor by robward-scisys.
the class FieldConfigGeometryField method populateExpression.
/**
* Populate expression.
*
* @param objValue the obj value
*/
/*
* (non-Javadoc)
*
* @see com.sldeditor.ui.detail.config.FieldConfigBase#populateExpression(java.lang.Object)
*/
@Override
public void populateExpression(Object objValue) {
String propertyName = null;
if (objValue instanceof PropertyExistsFunction) {
Expression e = ((PropertyExistsFunction) objValue).getParameters().get(0);
propertyName = e.toString();
} else if (objValue instanceof AttributeExpressionImpl) {
propertyName = ((AttributeExpressionImpl) objValue).getPropertyName();
} else if (objValue instanceof LiteralExpressionImpl) {
propertyName = AttributeUtils.extract((String) ((LiteralExpressionImpl) objValue).getValue());
}
populateField(propertyName);
}
use of org.geotools.filter.function.PropertyExistsFunction in project sldeditor by robward-scisys.
the class DataSourceAttributePanel method setAttribute.
/**
* Sets the attribute.
*
* @param expression the new attribute
*/
public void setAttribute(Expression expression) {
String propertyName = null;
if (expression instanceof PropertyExistsFunction) {
Expression e = ((PropertyExistsFunction) expression).getParameters().get(0);
Object value = ((LiteralExpressionImpl) e).getValue();
propertyName = ((AttributeExpressionImpl) value).getPropertyName();
} else if (expression instanceof AttributeExpressionImpl) {
propertyName = ((AttributeExpressionImpl) expression).getPropertyName();
} else if (expression instanceof LiteralExpressionImpl) {
propertyName = AttributeUtils.extract((String) ((LiteralExpressionImpl) expression).getValue());
}
if (propertyName != null) {
oldValueObj = propertyName;
attributeComboBox.setSelectedItem(propertyName);
} else {
oldValueObj = propertyName;
attributeComboBox.setSelectedIndex(-1);
}
}
Aggregations