use of org.opengis.filter.expression.NilExpression in project sldeditor by robward-scisys.
the class FieldConfigBase method populate.
/**
* Populate.
*
* @param expression the expression
*/
public void populate(Expression expression) {
if (attributeSelectionPanel != null) {
attributeSelectionPanel.populateAttributeComboxBox(expression);
}
if (expression == null) {
expressionType = ExpressionTypeEnum.E_VALUE;
revertToDefaultValue();
valueUpdated();
} else {
if (expression instanceof LiteralExpressionImpl) {
LiteralExpressionImpl lExpression = (LiteralExpressionImpl) expression;
Object objValue = lExpression.getValue();
if (objValue instanceof AttributeExpressionImpl) {
expressionType = ExpressionTypeEnum.E_ATTRIBUTE;
if (attributeSelectionPanel != null) {
attributeSelectionPanel.setAttribute((AttributeExpressionImpl) objValue);
}
setCachedExpression((AttributeExpressionImpl) objValue);
} else {
expressionType = ExpressionTypeEnum.E_VALUE;
populateExpression(objValue);
valueUpdated();
}
} else if (expression instanceof ConstantExpression) {
ConstantExpression cExpression = (ConstantExpression) expression;
Object objValue = cExpression.getValue();
expressionType = ExpressionTypeEnum.E_VALUE;
populateExpression(objValue);
valueUpdated();
} else if (expression instanceof NilExpression) {
Object objValue = null;
expressionType = ExpressionTypeEnum.E_VALUE;
populateExpression(objValue);
valueUpdated();
} else if (expression instanceof ProcessFunction) {
ProcessFunction processExpression = (ProcessFunction) expression;
Object objValue = processExpression;
expressionType = ExpressionTypeEnum.E_VALUE;
populateExpression(objValue);
valueUpdated();
} else if (expression instanceof AttributeExpressionImpl) {
expressionType = ExpressionTypeEnum.E_ATTRIBUTE;
if (attributeSelectionPanel != null) {
attributeSelectionPanel.setAttribute(expression);
} else {
populateExpression(expression);
}
setCachedExpression(expression);
} else if (expression instanceof FunctionExpressionImpl) {
expressionType = ExpressionTypeEnum.E_EXPRESSION;
if (attributeSelectionPanel != null) {
attributeSelectionPanel.populate(expression);
}
setCachedExpression(expression);
} else if (expression instanceof BinaryExpression) {
expressionType = ExpressionTypeEnum.E_EXPRESSION;
if (attributeSelectionPanel != null) {
attributeSelectionPanel.populate(expression);
}
setCachedExpression(expression);
} else {
expressionType = ExpressionTypeEnum.E_EXPRESSION;
}
}
setValueFieldState();
}
Aggregations