-import "Simantics/DB"
+import "Simantics/Variables"
import "Map" as Map
-import "Simantics/Testing/BuiltinKeys"
+include "Simantics/Testing/BuiltinKeys" as BuiltinKeys
importJava "org.simantics.browsing.ui.model.browsecontexts.BrowseContext" where
"""
"""
Finds value with the specified key or <code>null</code> if there was no value for the key
"""
- getConstant :: NodeContext -> ConstantKey -> <Proc> a
+ getConstant :: NodeContext -> BuiltinKeys.ConstantKey -> <Proc> a
importJava "org.eclipse.jface.resource.ImageDescriptor" where
data ImageDescriptor
importJava "org.simantics.browsing.ui.content.ImageDecorator" where
data ImageDecorator
-importJava "org.eclipse.jface.resource.JFaceResources" where
- getDefaultFontDescriptor :: FontDescriptor
-
importJava "org.eclipse.jface.resource.DeviceResourceDescriptor" where
data FontDescriptor
data ColorDescriptor
+importJava "org.eclipse.jface.resource.FontDescriptor" where
+ @private
+ @JavaName createFrom
+ createFontDescriptorFrom :: String -> Integer -> Integer -> FontDescriptor
+
+defaultFontDescriptor = createFontDescriptorFrom "Arial" 12 0
+
importJava "org.simantics.browsing.ui.content.LabelDecorator" where
"""
An interface for decorating aesthetic properties of an UI item, including the label text, font, background color and foreground color.
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.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.
importJava "org.simantics.browsing.ui.common.NodeContextBuilder" where
buildWithInput :: a -> <Proc> NodeContext
+instanceOfTest :: Variable -> <ReadGraph> (Resource -> <ReadGraph> Boolean)
+instanceOfTest self = do
+ typeResource = singleObject (represents $ parent self) MOD.InstanceOfTest.HasType
+ (\r -> isInstanceOf r typeResource)