]> gerrit.simantics Code Review - simantics/sysdyn.git/commitdiff
Lots of changes
authorvillberg <villberg@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Fri, 2 Dec 2011 08:35:53 +0000 (08:35 +0000)
committervillberg <villberg@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Fri, 2 Dec 2011 08:35:53 +0000 (08:35 +0000)
git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@23387 ac1ea38d-2e2b-0410-8846-a27921b304fc

org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/project/SysdynProject.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/validation/DependencyFunction.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/validation/ExpressionIssueFunction.java

index db04ecd42d9e38640c4a3e721b9914d11b830f2b..fb9fff6563d1a4122ad8848272e9e2083a69e36e 100644 (file)
@@ -39,7 +39,7 @@ import org.simantics.db.request.Read;
 import org.simantics.db.service.GraphChangeListenerSupport;\r
 import org.simantics.db.service.LifecycleSupport;\r
 import org.simantics.db.service.VirtualGraphSupport;\r
-import org.simantics.issues.common.IssueUtil;\r
+import org.simantics.issues.common.IssueUtils;\r
 import org.simantics.layer0.Layer0;\r
 import org.simantics.modeling.services.CaseInsensitiveComponentNamingStrategy2;\r
 import org.simantics.modeling.services.ComponentNamingStrategy;\r
@@ -295,7 +295,7 @@ public class SysdynProject extends AbstractProjectFeature {
 \r
         });\r
         \r
-        IssueUtil.listenActiveProjectIssueSources(graph, project.get());\r
+        IssueUtils.listenActiveProjectIssueSources(graph, project.get());\r
         \r
     }\r
 \r
index 8a55054442966c22a8cc8ca040ee7fe6cd4eaae8..dbad2a45667f3a4b49569bca01f96f45d474f5af 100644 (file)
@@ -19,13 +19,12 @@ import java.util.Set;
 \r
 import org.simantics.db.ReadGraph;\r
 import org.simantics.db.Resource;\r
-import org.simantics.db.common.utils.ListUtils;\r
 import org.simantics.db.common.utils.NameUtils;\r
 import org.simantics.db.exception.DatabaseException;\r
 import org.simantics.db.layer0.variable.Variable;\r
 import org.simantics.issues.common.Issue;\r
+import org.simantics.issues.common.IssueUtils;\r
 import org.simantics.issues.common.StandardIssue;\r
-import org.simantics.issues.ontology.IssueResource;\r
 import org.simantics.layer0.Layer0;\r
 import org.simantics.scl.reflection.annotations.SCLValue;\r
 import org.simantics.sysdyn.SysdynResource;\r
@@ -153,12 +152,10 @@ public class DependencyFunction {
      * @throws DatabaseException\r
      */\r
     @SCLValue(type = "ReadGraph -> Resource -> Variable -> String")\r
-    public static String missingLinkIssueDescription(ReadGraph graph, Resource converter, Variable issue)\r
+    public static String missingLinkIssueDescription(ReadGraph graph, Resource converter, Variable property)\r
             throws DatabaseException {\r
-        IssueResource ISSUE = IssueResource.getInstance(graph);\r
-        Resource issueResource = issue.getRepresents(graph);\r
-        Resource list = graph.getSingleObject(issueResource, ISSUE.Sources_DependencyTracker_Issue_HasContexts);\r
-        List<Resource> contexts = ListUtils.toList(graph, list);\r
+       \r
+       List<Resource> contexts = IssueUtils.getContextsForProperty(graph, property);\r
         String result = "Missing a link to ";\r
         if (contexts.size() > 0) {\r
             Resource component = contexts.get(1);\r
@@ -166,6 +163,7 @@ public class DependencyFunction {
             result = result + name;\r
         }\r
         return result;\r
+        \r
     }\r
 \r
     /**\r
@@ -178,12 +176,10 @@ public class DependencyFunction {
      * @throws DatabaseException\r
      */\r
     @SCLValue(type = "ReadGraph -> Resource -> Variable -> String")\r
-    public static String unusedDependencyIssueDescription(ReadGraph graph, Resource converter, Variable issue)\r
+    public static String unusedDependencyIssueDescription(ReadGraph graph, Resource converter, Variable property)\r
             throws DatabaseException {\r
-        IssueResource ISSUE = IssueResource.getInstance(graph);\r
-        Resource issueResource = issue.getRepresents(graph);\r
-        Resource list = graph.getSingleObject(issueResource, ISSUE.Sources_DependencyTracker_Issue_HasContexts);\r
-        List<Resource> contexts = ListUtils.toList(graph, list);\r
+       \r
+       List<Resource> contexts = IssueUtils.getContextsForProperty(graph, property);\r
         String result = "Unused dependency: ";\r
         if (contexts.size() > 0) {\r
             Resource component = contexts.get(1);\r
@@ -204,12 +200,10 @@ public class DependencyFunction {
      * @throws DatabaseException\r
      */\r
     @SCLValue(type = "ReadGraph -> Resource -> Variable -> String")\r
-    public static String noSuchVariableIssueDescription(ReadGraph graph, Resource converter, Variable issue)\r
+    public static String noSuchVariableIssueDescription(ReadGraph graph, Resource converter, Variable property)\r
             throws DatabaseException {\r
-        IssueResource ISSUE = IssueResource.getInstance(graph);\r
-        Resource issueResource = issue.getRepresents(graph);\r
-        Resource list = graph.getSingleObject(issueResource, ISSUE.Sources_DependencyTracker_Issue_HasContexts);\r
-        List<Resource> contexts = ListUtils.toList(graph, list);\r
+       \r
+       List<Resource> contexts = IssueUtils.getContextsForProperty(graph, property);\r
         Resource component = contexts.get(0);\r
 \r
         // Find all variables that are linked to component with arrows\r
index 8bc51ede0d831059847400cbd69ae1d218dc6b9f..e21926a6244828fd6ba0d5c8f82b472341639450 100644 (file)
@@ -16,12 +16,11 @@ import java.util.List;
 \r
 import org.simantics.db.ReadGraph;\r
 import org.simantics.db.Resource;\r
-import org.simantics.db.common.utils.ListUtils;\r
 import org.simantics.db.exception.DatabaseException;\r
 import org.simantics.db.layer0.variable.Variable;\r
 import org.simantics.issues.common.Issue;\r
+import org.simantics.issues.common.IssueUtils;\r
 import org.simantics.issues.common.StandardIssue;\r
-import org.simantics.issues.ontology.IssueResource;\r
 import org.simantics.scl.reflection.annotations.SCLValue;\r
 import org.simantics.sysdyn.SysdynResource;\r
 \r
@@ -56,11 +55,9 @@ public class ExpressionIssueFunction {
     }\r
     \r
     @SCLValue(type = "ReadGraph -> Resource -> Variable -> String")\r
-    public static String expressionIssueDescription(ReadGraph graph, Resource converter, Variable issue) throws DatabaseException {\r
-        IssueResource ISSUE = IssueResource.getInstance(graph);\r
-        Resource issueResource = issue.getRepresents(graph);\r
-        Resource list = graph.getSingleObject(issueResource, ISSUE.Sources_DependencyTracker_Issue_HasContexts);\r
-        List<Resource> contexts = ListUtils.toList(graph, list);\r
+    public static String expressionIssueDescription(ReadGraph graph, Resource converter, Variable property) throws DatabaseException {\r
+       \r
+       List<Resource> contexts = IssueUtils.getContextsForProperty(graph, property);\r
         Resource component = contexts.get(0);\r
         \r
         // There should be an error\r