X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.document.linking.ui%2Fsrc%2Forg%2Fsimantics%2Fdocument%2Flinking%2Freport%2Fevaluator%2FEvaluatorItem.java;fp=bundles%2Forg.simantics.document.linking.ui%2Fsrc%2Forg%2Fsimantics%2Fdocument%2Flinking%2Freport%2Fevaluator%2FEvaluatorItem.java;h=e131ce302f455093cf98d6138d31e8f4baf7ba29;hb=969bd23cab98a79ca9101af33334000879fb60c5;hp=0000000000000000000000000000000000000000;hpb=866dba5cd5a3929bbeae85991796acb212338a08;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.document.linking.ui/src/org/simantics/document/linking/report/evaluator/EvaluatorItem.java b/bundles/org.simantics.document.linking.ui/src/org/simantics/document/linking/report/evaluator/EvaluatorItem.java new file mode 100644 index 000000000..e131ce302 --- /dev/null +++ b/bundles/org.simantics.document.linking.ui/src/org/simantics/document/linking/report/evaluator/EvaluatorItem.java @@ -0,0 +1,71 @@ +package org.simantics.document.linking.report.evaluator; + +import java.util.List; +import java.util.Map; + +import org.eclipse.jface.resource.ImageDescriptor; +import org.simantics.db.ReadGraph; +import org.simantics.db.exception.DatabaseException; +import org.simantics.db.layer0.variable.Variable; +import org.simantics.document.linking.report.DocumentLine; + + +/** + * Base interface for user configurable content. + * + * @author Marko Luukkainen + * + */ +public interface EvaluatorItem { + + /** + * Returns rootNode of the evaluation tree, or null. + * @return + */ + public EvaluatorRoot getRoot(); + + /** + * Return parent node, or null. + * @return + */ + public EvaluatorNode getParent(); + + /** + * Sets parent node. This method is for internal use only. + * @param parent + */ + void setParent(EvaluatorNode parent); + + /** + * Returns result of evaluation as a single String. Lines are separated with line.separator system property. All styling hints are omitted. + * @param graph + * @param variable + * @param context + * @return + * @throws DatabaseException + */ + public String getValue(ReadGraph graph, Variable variable, Map context) throws DatabaseException; + + /** + * Returns result of evaluation as collection of lines with styling hints. + * @param graph + * @param variable + * @param context + * @return + * @throws DatabaseException + */ + public List getLines(ReadGraph graph, Variable variable, Map context) throws DatabaseException; + + /** + * Copies the evaluation node and its children. + * @return + */ + public EvaluatorItem copy(); + + + + public ImageDescriptor getImage(); + + + +}