1 package org.simantics.document.linking.report.evaluator;
3 import java.util.ArrayList;
7 import org.eclipse.jface.resource.ImageDescriptor;
8 import org.simantics.db.ReadGraph;
9 import org.simantics.db.exception.DatabaseException;
10 import org.simantics.db.layer0.variable.Variable;
11 import org.simantics.document.linking.Activator;
12 import org.simantics.document.linking.ontology.DocumentLink;
13 import org.simantics.document.linking.report.DocumentLine;
14 import org.simantics.objmap.graph.annotations.OrderedSetType;
17 * Combines child node contents to separate lines.
19 * If all children return null, the return value is null.
21 * @author Marko Luukkainen <marko.luukkainen@vtt.fi>
24 @OrderedSetType(DocumentLink.URIs.EvaluatorTree_Lines)
25 public class Lines extends EvaluatorNode {
29 public String getValue(ReadGraph graph, Variable variable, Map<Object, Object> context) throws DatabaseException {
31 for (int i = 0 ; i < children.size(); i++) {
32 String s2 = children.get(i).getValue(graph, variable, context);
35 if (i < children.size()-1)
36 s+=System.getProperty("line.separator");
46 public String toString() {
53 public List<DocumentLine> getLines(ReadGraph graph, Variable variable, Map<Object, Object> context) throws DatabaseException {
54 List<DocumentLine> result = new ArrayList<DocumentLine>();
55 for (int i = 0 ; i < children.size(); i++) {
56 result.addAll(children.get(i).getLines(graph, variable, context));
62 public EvaluatorItem copy() {
63 Lines lines = new Lines();
69 public ImageDescriptor getImage() {
70 return Activator.imageDescriptorFromPlugin("com.famfamfam.silk", "icons/text_linespacing.png");