X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=bundles%2Forg.simantics.modeling.ui%2Fscl%2FSimantics%2FTesting%2FBrowseContext.scl;h=a662f57f4a47695501052d30dba1072e5d6ad66f;hb=5bf5e25b6691f1e0ce1969b7ce7ca685e29039f7;hp=3edb179fc295adc3c7ac223a70f04e49f857ad45;hpb=53e9b3dac5648f360cd91478d9e6e7a495631b08;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 3edb179fc..a662f57f4 100644 --- a/bundles/org.simantics.modeling.ui/scl/Simantics/Testing/BrowseContext.scl +++ b/bundles/org.simantics.modeling.ui/scl/Simantics/Testing/BrowseContext.scl @@ -1,6 +1,6 @@ -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 """ @@ -68,7 +68,7 @@ importJava "org.simantics.browsing.ui.NodeContext" where """ Finds value with the specified key or null if there was no value for the key """ - getConstant :: NodeContext -> ConstantKey -> a + getConstant :: NodeContext -> BuiltinKeys.ConstantKey -> a importJava "org.eclipse.jface.resource.ImageDescriptor" where data ImageDescriptor @@ -126,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)