]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.modeling.ui/scl/Simantics/Testing/BrowseContext.scl
Fixed multiple issues causing dangling references to discarded queries
[simantics/platform.git] / bundles / org.simantics.modeling.ui / scl / Simantics / Testing / BrowseContext.scl
index a662f57f4a47695501052d30dba1072e5d6ad66f..d051042d5f4258b6c92acbace7b52eeec2a9114b 100644 (file)
@@ -78,6 +78,8 @@ importJava "org.simantics.browsing.ui.content.ImageDecorator" where
 
 importJava "org.eclipse.jface.resource.DeviceResourceDescriptor" where
     data FontDescriptor
+
+importJava "org.eclipse.jface.resource.ColorDescriptor" where    
     data ColorDescriptor
 
 importJava "org.eclipse.jface.resource.FontDescriptor" where
@@ -85,6 +87,11 @@ importJava "org.eclipse.jface.resource.FontDescriptor" where
     @JavaName createFrom
     createFontDescriptorFrom :: String -> Integer -> Integer -> FontDescriptor
 
+importJava "org.simantics.modeling.ColorDescriptorUtil" where
+    colorDescriptorAsHex :: ColorDescriptor -> <Proc> String
+    colorDescriptorAsTuple3 :: ColorDescriptor -> <Proc> (Double, Double, Double)
+    colorDescriptor :: (Double, Double, Double) -> <Proc> ColorDescriptor
+
 defaultFontDescriptor = createFontDescriptorFrom "Arial" 12 0 
 
 importJava "org.simantics.browsing.ui.content.LabelDecorator" where
@@ -97,13 +104,16 @@ importJava "org.simantics.browsing.ui.content.LabelDecorator" where
     Decorates the given label with the name of the UI column which the label is for and  the index of this label within its parenting INodeContext.
     Returns the decorated Label 
     """
-    decorateLabel :: LabelDecorator -> String -> String -> Integer -> <Proc> String
+    decorateLabel :: LabelDecorator -> String -> String -> Integer -> <Proc> Maybe String
     decorateForeground :: LabelDecorator -> a -> String -> Integer -> <Proc> a
     decorateBackground :: LabelDecorator -> a -> String -> Integer -> <Proc> a
     decorateFont :: LabelDecorator -> Maybe a -> String -> Integer -> <Proc> Maybe a
 
 importJava "org.simantics.browsing.ui.CheckedState" where
     data CheckedState
+    CHECKED :: CheckedState
+    GRAYED :: CheckedState
+    NOT_CHECKED :: CheckedState
 
 importJava "org.simantics.browsing.ui.content.Labeler$Modifier" where
     data Modifier
@@ -115,6 +125,7 @@ importJava "org.simantics.browsing.ui.content.Labeler$Modifier" where
 importJava "org.simantics.browsing.ui.model.browsecontexts.BrowseContexts" where
     toBrowseContextG :: Vector String -> <ReadGraph> BrowseContext
     getNodeContextForResource :: Resource -> <Proc> NodeContext
+    getNodeContextWithTypeForResource :: Resource -> <Proc, ReadGraph> NodeContext
 
 """
 Creates a new BrowseContext for the given Collection of Resources.
@@ -130,3 +141,6 @@ instanceOfTest :: Variable -> <ReadGraph> (Resource -> <ReadGraph> Boolean)
 instanceOfTest self = do
   typeResource = singleObject (represents $ parent self) MOD.InstanceOfTest.HasType
   (\r -> isInstanceOf r typeResource) 
+
+type BrowseNodeRule a = VariableOrResource -> <ReadGraph,Proc> a  
+  
\ No newline at end of file