From 8d7b4615b1e0c7dec59c39e5e5f312a261fd1baf Mon Sep 17 00:00:00 2001 From: Antti Villberg Date: Tue, 22 Nov 2016 13:47:55 +0200 Subject: [PATCH] Initial version of SCL tab contributions refs #6824 Change-Id: I677f82bc7a0cd5ec03937384d9a130c00ddefa9b --- .../graph.tg | Bin 11392 -> 11656 bytes .../graph/Selectionview.pgraph | 3 ++ .../selectionview/SelectionViewResources.java | 9 +++++ .../scl/Simantics/SelectionView.scl | 4 +++ .../selectionview/SCLTabContribution.java | 34 ++++++++++++++++++ 5 files changed, 50 insertions(+) create mode 100644 bundles/org.simantics.selectionview/src/org/simantics/selectionview/SCLTabContribution.java diff --git a/bundles/org.simantics.selectionview.ontology/graph.tg b/bundles/org.simantics.selectionview.ontology/graph.tg index 49a3f113fe75e9b05e284fbbc135154403e939a8..724deb153af635e054d7f73ad28e8991e96f162b 100644 GIT binary patch literal 11656 zcmb`NiFXuL7RE`)z5oGK&?r%n0Tl#PL`573TNDT;VNr3ZbXStXPF1Mx2IA-_ZX=E> z>Zs$s4etAbJL0~t^Y_er-|crhmlrZ~&Ya0PH+jE%zjxn#OH~(iRrjaC(7?EH<0@d| zYWd6kR5zz#J}IV|ustcpg-W^`!d-bj12q-S+Qz7Q0`L3An=EM04M1i9jWpFy?AWZo$LpKb#8>rAkivYIVBckY~* zj|KxQOeQ}sN&BIw8joKUE!|-*%&@pkQMhyNf_V$!?PRE`X+@MD$_2xlSPC3hi+Aek zFb>lwvms4}!n82lJ`m-yh+bIg(~<8UNOr~><7}A1yI#Dtf}MSED%pxG?`MwekD zHX6=IoRg5bBOWRi)+O1fFOpI}VEzINz6~g8>f#25l*qv@$LZhN<`^DW`R_M4K~7E=kSe z-74;;z9hCwIz_y#-q8MlldWpZvW^hdOk6B+Hb}GOV=LP@Y7)buZjQV?j_Izd8PFs0 zB{?=5xmyI2u^-(-VI~T4da9uNim}~Be2a)%R$rT=Fj+{HmA2Ar1 zTp3Zz#J>&NtDjHFK_O`6bUIzVrq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o(s`O3^c3Z~NuGq@3^ z%>A!{HNbv>F-F$;a%`5lHkP?|mbsUfdHyWV@tF4_8=vR#e2@7ow0b^!EidtSsmFX* zvHA{=*Li%A$Ll@b>~W9BJ3Q|7IPY=jai7Qi9!DPU_PFfvu*Z8mzR}}bJl^YA&rcn= z3a00UYs-7=l?=$A+oe^-2mi&=Y?U8a%nxDP#69|(%~s(fzjo*z!@tGL-z0oQHyb_K z2H`*WoM7!(fi+%*)xt+~be*_4`3t;+<-&jbMc54zo2|bk&7Qw}_OdPbopLR|C|q9g zqw4wpp~`t)k7s68^+N!^s`^p&Dp8u>+wSBH};by15R4JQOT7_)jqkT7uV-dbvG+!|m^~1#>e6F;h@}(6&Uec4m#oZ;j zqnAh^-SDr=nk!8_wVGXb{L#`*u&M#ybp?6+D9;;w_MxeiY*;l?3RPX*?6$b#Xjq@b z{S|6lQ%C~&sED-- SEL.AbstractTypedResourceTabContribution.HasType --> L0.Type -- SEL.SCLTabContribution.instantiate ==> "() -> TabContribution" -- SEL.VariableTabContribution.HasTest -- SEL.VariableTabContribution.transformation ==> "Variable -> Variable" a -> () standardSetDisplayValue3 :: Variable -> a -> Binding a -> () standardGetDisplayValueDatatype :: Variable -> Datatype + +importJava "org.simantics.selectionview.TabContribution" where + data TabContribution + \ No newline at end of file diff --git a/bundles/org.simantics.selectionview/src/org/simantics/selectionview/SCLTabContribution.java b/bundles/org.simantics.selectionview/src/org/simantics/selectionview/SCLTabContribution.java new file mode 100644 index 000000000..61921dd27 --- /dev/null +++ b/bundles/org.simantics.selectionview/src/org/simantics/selectionview/SCLTabContribution.java @@ -0,0 +1,34 @@ +package org.simantics.selectionview; + +import java.util.Collection; + +import org.simantics.db.ReadGraph; +import org.simantics.db.Resource; +import org.simantics.db.exception.DatabaseException; +import org.simantics.db.layer0.variable.Variable; +import org.simantics.db.layer0.variable.Variables; +import org.simantics.scl.runtime.function.Function1; +import org.simantics.scl.runtime.tuple.Tuple0; + +public class SCLTabContribution implements TabContribution { + + final private TabContribution contribution; + + public SCLTabContribution(ReadGraph graph, Resource configuration) throws DatabaseException { + Variable var = Variables.getVariable(graph, configuration); + Function1> function = var.getPropertyValue(graph, "instantiate"); + contribution = function.apply(Tuple0.INSTANCE); + } + + @Override + public boolean accept(ReadGraph graph, Object input) throws DatabaseException { + return contribution.accept(graph, input); + } + + @Override + public void contribute(ReadGraph graph, Object selection, Collection result) + throws DatabaseException { + contribution.contribute(graph, selection, result); + } + +} -- 2.47.1