X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.modeling.ui%2Fscl%2FSimantics%2FTesting%2FBrowseContext.scl;h=cd4e9755dfa1e9a81d343c19189e235a8bf9e2d7;hb=refs%2Fchanges%2F88%2F488%2F1;hp=d3890192e711495363cff0b7ac6517cdc191f8f1;hpb=a0e3814041d624e3d72c21210d188e56439757aa;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.modeling.ui/scl/Simantics/Testing/BrowseContext.scl b/bundles/org.simantics.modeling.ui/scl/Simantics/Testing/BrowseContext.scl index d3890192e..cd4e9755d 100644 --- a/bundles/org.simantics.modeling.ui/scl/Simantics/Testing/BrowseContext.scl +++ b/bundles/org.simantics.modeling.ui/scl/Simantics/Testing/BrowseContext.scl @@ -1,4 +1,4 @@ -import "Simantics/DB" +import "Simantics/Variables" import "Map" as Map import "Simantics/Testing/BuiltinKeys" @@ -76,13 +76,17 @@ importJava "org.eclipse.jface.resource.ImageDescriptor" where 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. @@ -122,3 +126,7 @@ createBrowseContext resource = do importJava "org.simantics.browsing.ui.common.NodeContextBuilder" where buildWithInput :: a -> NodeContext +instanceOfTest :: Variable -> (Resource -> Boolean) +instanceOfTest self = do + typeResource = singleObject (represents $ parent self) MOD.InstanceOfTest.HasType + (\r -> isInstanceOf r typeResource)