]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.scl.db/scl/Simantics/Variables.scl
Playground for Antti.
[simantics/platform.git] / bundles / org.simantics.scl.db / scl / Simantics / Variables.scl
index 43be6defbb6ee486957572caff2abe9d0a93f226..47bdaba3c7ebf3c044a46f3536bf4f743cc91fd7 100644 (file)
@@ -421,6 +421,9 @@ instance Browsable Variable where
     variantValueOf v = createVariant (datatype v) (untypedValue v :: Dynamic)
     child = child_
     possibleChild = possibleChild_
+    
+    genericRelatedValue v rel = untypedPropertyValue v (nameOf rel)
+    genericPossibleRelatedValue v rel = untypedPossiblePropertyValue v (nameOf rel)
 
 propertiesClassified :: Variable -> Resource -> <ReadGraph> [Variable]
 propertiesClassified parent classified = do
@@ -434,4 +437,15 @@ importJava "org.simantics.db.layer0.variable.RVI" where
 instantiateUnder :: Resource -> Resource -> <WriteGraph> Resource
 instantiateUnder container typeToInstantiate = do
     fn = (resourceVariable typeToInstantiate)#methods#instantiateUnder :: Resource -> Resource -> <WriteGraph> Resource  
-    fn container typeToInstantiate
\ No newline at end of file
+    fn container typeToInstantiate
+
+@JavaType "org.simantics.db.layer0.variable.VariableOrResource"
+data VariableOrResource =
+    @JavaType "org.simantics.db.layer0.variable.ResourceX"
+    @FieldNames [value]
+    ResourceX Resource
+  | @JavaType "org.simantics.db.layer0.variable.VariableX"
+    @FieldNames [value]
+    VariableX Variable
+    
+    
\ No newline at end of file