import org.simantics.issues.ontology.IssueResource;
import org.simantics.layer0.Layer0;
import org.simantics.scl.reflection.annotations.SCLValue;
+import org.simantics.scl.runtime.function.Function1;
public class All {
if(issueRoot.equals(contextRoot)) {
String uri = graph.getURI(parent);
String contextURI = graph.getURI(contextRoot);
+ if (uri.equals(contextURI)) return "";
return IssueUtils.pathString(uri, contextURI.length()+1);
} else {
String uri = graph.getURI(parent);
throw new IllegalArgumentException("Unsupported property type: " + property);
}
+ @SCLValue(type = "ReadGraph -> Resource -> a -> b")
+ public static Function1<Boolean, Boolean> standardIssueHider(ReadGraph graph, Resource converter, Object property) throws DatabaseException {
+ if (property instanceof Variable) {
+ Variable hider = (Variable) property;
+ Variable issue = hider.getParent(graph);
+ Resource r = issue.getPossibleRepresents(graph);
+ if (r != null)
+ return new HideFunction(r);
+ }
+ return null;
+ }
+
+ @SCLValue(type = "ReadGraph -> Resource -> a -> Boolean")
+ public static Boolean standardIssueHidden(ReadGraph graph, Resource converter, Object property) throws DatabaseException {
+ if (property instanceof Variable) {
+ Variable hidden = (Variable) property;
+ Variable issue = hidden.getParent(graph);
+ Resource r = issue.getPossibleRepresents(graph);
+ if (r != null) {
+ IssueResource ISSUE = IssueResource.getInstance(graph);
+ return graph.hasStatement(r, ISSUE.Hidden);
+ }
+ }
+ return false;
+ }
+
}