]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.document.linking.ui/src/org/simantics/document/linking/report/evaluator/EvaluatorItem.java
Fixed all line endings of the repository
[simantics/platform.git] / bundles / org.simantics.document.linking.ui / src / org / simantics / document / linking / report / evaluator / EvaluatorItem.java
1 package org.simantics.document.linking.report.evaluator;
2
3 import java.util.List;
4 import java.util.Map;
5
6 import org.eclipse.jface.resource.ImageDescriptor;
7 import org.simantics.db.ReadGraph;
8 import org.simantics.db.exception.DatabaseException;
9 import org.simantics.db.layer0.variable.Variable;
10 import org.simantics.document.linking.report.DocumentLine;
11
12
13 /**
14  * Base interface for user configurable content.
15  * 
16  * @author Marko Luukkainen <marko.luukkainen@vtt.fi>
17  *
18  */
19 public interface EvaluatorItem {
20         
21         /**
22          * Returns rootNode of the evaluation tree, or null.
23          * @return
24          */
25         public EvaluatorRoot getRoot();
26         
27         /**
28          * Return parent node, or null.
29          * @return
30          */
31         public EvaluatorNode getParent();
32         
33         /**
34          * Sets parent node. This method is for internal use only. 
35          * @param parent
36          */
37         void setParent(EvaluatorNode parent);
38         
39         /**
40          * Returns result of evaluation as a single String. Lines are separated with line.separator system property. All styling hints are omitted.
41          * @param graph
42          * @param variable
43          * @param context
44          * @return
45          * @throws DatabaseException
46          */
47         public String getValue(ReadGraph graph, Variable variable, Map<Object, Object> context) throws DatabaseException;
48         
49         /**
50          * Returns result of evaluation as collection of lines with styling hints.
51          * @param graph
52          * @param variable
53          * @param context
54          * @return
55          * @throws DatabaseException
56          */
57         public List<DocumentLine> getLines(ReadGraph graph, Variable variable, Map<Object, Object> context) throws DatabaseException;
58         
59         /**
60          * Copies the evaluation node and its children.
61          * @return
62          */
63         public EvaluatorItem copy();
64         
65         
66         
67         public ImageDescriptor getImage();
68         
69         
70         
71 }