]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/request/ResourceToPossibleVariable.java
Fixed all line endings of the repository
[simantics/platform.git] / bundles / org.simantics.db.layer0 / src / org / simantics / db / layer0 / request / ResourceToPossibleVariable.java
index 8738f0e1a0eecbe45b2249a967c60498a91b6831..3dc2ee396215f7e2e06fec478f355e6678df6d93 100644 (file)
@@ -1,32 +1,32 @@
-package org.simantics.db.layer0.request;\r
-\r
-import org.simantics.db.ReadGraph;\r
-import org.simantics.db.Resource;\r
-import org.simantics.db.common.request.ResourceRead;\r
-import org.simantics.db.exception.DatabaseException;\r
-import org.simantics.db.layer0.variable.StandardGraphChildVariable;\r
-import org.simantics.db.layer0.variable.Variable;\r
-import org.simantics.layer0.Layer0;\r
-\r
-public class ResourceToPossibleVariable extends ResourceRead<Variable> {\r
-\r
-       public ResourceToPossibleVariable(Resource resource) {\r
-               super(resource);\r
-       }\r
-       \r
-       @Override\r
-       public Variable perform(ReadGraph graph) throws DatabaseException {\r
-               \r
-               Layer0 L0 = Layer0.getInstance(graph);\r
-               Resource parent = graph.getPossibleObject(resource, L0.PartOf);\r
-               if(parent == null) {\r
-                       if(graph.getRootLibrary().equals(resource)) return new StandardGraphChildVariable(null, null, graph.getRootLibrary());\r
-                       else return null;\r
-               }\r
-               Variable parentVariable = graph.syncRequest(new ResourceToPossibleVariable(parent));\r
-               if(parentVariable == null) return null;\r
-               return parentVariable.browsePossible(graph, resource);\r
-               \r
-       }\r
-\r
-}\r
+package org.simantics.db.layer0.request;
+
+import org.simantics.db.ReadGraph;
+import org.simantics.db.Resource;
+import org.simantics.db.common.request.ResourceRead;
+import org.simantics.db.exception.DatabaseException;
+import org.simantics.db.layer0.variable.StandardGraphChildVariable;
+import org.simantics.db.layer0.variable.Variable;
+import org.simantics.layer0.Layer0;
+
+public class ResourceToPossibleVariable extends ResourceRead<Variable> {
+
+       public ResourceToPossibleVariable(Resource resource) {
+               super(resource);
+       }
+       
+       @Override
+       public Variable perform(ReadGraph graph) throws DatabaseException {
+               
+               Layer0 L0 = Layer0.getInstance(graph);
+               Resource parent = graph.getPossibleObject(resource, L0.PartOf);
+               if(parent == null) {
+                       if(graph.getRootLibrary().equals(resource)) return new StandardGraphChildVariable(null, null, graph.getRootLibrary());
+                       else return null;
+               }
+               Variable parentVariable = graph.syncRequest(new ResourceToPossibleVariable(parent));
+               if(parentVariable == null) return null;
+               return parentVariable.browsePossible(graph, resource);
+               
+       }
+
+}