]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.modeling/src/org/simantics/modeling/adapters/SCLChildRule.java
Fixed all line endings of the repository
[simantics/platform.git] / bundles / org.simantics.modeling / src / org / simantics / modeling / adapters / SCLChildRule.java
index 8ca1b9ae8b5a676a8916a1b8b4ce95ac0bde9ca7..52349e5821acec2f1a8d476b9c31cd901c8b2ad1 100644 (file)
@@ -1,59 +1,59 @@
-package org.simantics.modeling.adapters;\r
-\r
-import java.util.Collection;\r
-import java.util.Collections;\r
-import java.util.List;\r
-\r
-import org.simantics.browsing.ui.model.children.ChildRule;\r
-import org.simantics.db.ReadGraph;\r
-import org.simantics.db.Resource;\r
-import org.simantics.db.exception.DatabaseException;\r
-import org.simantics.db.layer0.variable.Variable;\r
-import org.simantics.db.layer0.variable.Variables;\r
-import org.simantics.modeling.ModelingResources;\r
-import org.simantics.scl.runtime.SCLContext;\r
-import org.simantics.scl.runtime.function.Function1;\r
-\r
-public class SCLChildRule implements ChildRule {\r
-\r
-    private Resource rule;\r
-    \r
-    public SCLChildRule(ReadGraph graph, Resource rule) {\r
-        this.rule = rule;\r
-    }\r
-    \r
-    @Override\r
-    public boolean isCompatible(Class<?> contentType) {\r
-        return contentType.equals(Resource.class) || contentType.equals(Variable.class);\r
-    }\r
-\r
-    @Override\r
-    public Collection<?> getChildren(ReadGraph graph, Object parent) throws DatabaseException {\r
-        \r
-        ModelingResources MOD = ModelingResources.getInstance(graph);\r
-        \r
-        Variable ruleVariable = Variables.getVariable(graph, rule);\r
-\r
-        Function1<Object,List<?>> getChildren = ruleVariable.getPossiblePropertyValue(graph, MOD.SCLChildRule_getChildren);\r
-        if(getChildren == null) return Collections.emptyList();\r
-\r
-        SCLContext sclContext = SCLContext.getCurrent();\r
-        Object oldGraph = sclContext.get("graph");\r
-        try {\r
-            sclContext.put("graph", graph);\r
-            Object value = getChildren.apply(parent);\r
-            return (Collection<?>)value;\r
-        } catch (Throwable t) {\r
-               throw new DatabaseException(t);\r
-        } finally {\r
-            sclContext.put("graph", oldGraph);\r
-        }\r
-\r
-    }\r
-\r
-    @Override\r
-    public Collection<?> getParents(ReadGraph graph, Object child) throws DatabaseException {\r
-        return null;\r
-    }\r
-\r
-}\r
+package org.simantics.modeling.adapters;
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+
+import org.simantics.browsing.ui.model.children.ChildRule;
+import org.simantics.db.ReadGraph;
+import org.simantics.db.Resource;
+import org.simantics.db.exception.DatabaseException;
+import org.simantics.db.layer0.variable.Variable;
+import org.simantics.db.layer0.variable.Variables;
+import org.simantics.modeling.ModelingResources;
+import org.simantics.scl.runtime.SCLContext;
+import org.simantics.scl.runtime.function.Function1;
+
+public class SCLChildRule implements ChildRule {
+
+    private Resource rule;
+    
+    public SCLChildRule(ReadGraph graph, Resource rule) {
+        this.rule = rule;
+    }
+    
+    @Override
+    public boolean isCompatible(Class<?> contentType) {
+        return contentType.equals(Resource.class) || contentType.equals(Variable.class);
+    }
+
+    @Override
+    public Collection<?> getChildren(ReadGraph graph, Object parent) throws DatabaseException {
+        
+        ModelingResources MOD = ModelingResources.getInstance(graph);
+        
+        Variable ruleVariable = Variables.getVariable(graph, rule);
+
+        Function1<Object,List<?>> getChildren = ruleVariable.getPossiblePropertyValue(graph, MOD.SCLChildRule_getChildren);
+        if(getChildren == null) return Collections.emptyList();
+
+        SCLContext sclContext = SCLContext.getCurrent();
+        Object oldGraph = sclContext.get("graph");
+        try {
+            sclContext.put("graph", graph);
+            Object value = getChildren.apply(parent);
+            return (Collection<?>)value;
+        } catch (Throwable t) {
+               throw new DatabaseException(t);
+        } finally {
+            sclContext.put("graph", oldGraph);
+        }
+
+    }
+
+    @Override
+    public Collection<?> getParents(ReadGraph graph, Object child) throws DatabaseException {
+        return null;
+    }
+
+}