2010-02-04 07:30:56 +01:00
|
|
|
package com.metaweb.gridworks.expr;
|
|
|
|
|
|
|
|
import java.util.Properties;
|
|
|
|
|
|
|
|
import com.metaweb.gridworks.model.Cell;
|
|
|
|
import com.metaweb.gridworks.model.Project;
|
|
|
|
import com.metaweb.gridworks.model.Row;
|
|
|
|
|
|
|
|
public class ExpressionUtils {
|
|
|
|
static public Properties createBindings(Project project) {
|
|
|
|
Properties bindings = new Properties();
|
2010-02-05 00:38:40 +01:00
|
|
|
|
|
|
|
bindings.put("true", true);
|
|
|
|
bindings.put("false", false);
|
|
|
|
|
2010-02-04 07:30:56 +01:00
|
|
|
bindings.put("project", project);
|
2010-02-05 00:38:40 +01:00
|
|
|
|
2010-02-04 07:30:56 +01:00
|
|
|
return bindings;
|
|
|
|
}
|
|
|
|
|
|
|
|
static public void bind(Properties bindings, Row row, Cell cell) {
|
|
|
|
bindings.put("row", row);
|
|
|
|
bindings.put("cells", row.getField("cells", bindings));
|
|
|
|
|
|
|
|
bindings.put("cell", cell);
|
|
|
|
bindings.put("value", cell.value);
|
|
|
|
}
|
|
|
|
}
|