[rkward-cvs] SF.net SVN: rkward:[4439] branches/external_plugins
m-eik at users.sourceforge.net
m-eik at users.sourceforge.net
Wed Nov 21 15:24:26 UTC 2012
Revision: 4439
http://rkward.svn.sourceforge.net/rkward/?rev=4439&view=rev
Author: m-eik
Date: 2012-11-21 15:24:26 +0000 (Wed, 21 Nov 2012)
Log Message:
-----------
add stuff
Added Paths:
-----------
branches/external_plugins/stuff/
branches/external_plugins/stuff/embedding_test.R
branches/external_plugins/stuff/rk.embeddingtest/
Added: branches/external_plugins/stuff/embedding_test.R
===================================================================
--- branches/external_plugins/stuff/embedding_test.R (rev 0)
+++ branches/external_plugins/stuff/embedding_test.R 2012-11-21 15:24:26 UTC (rev 4439)
@@ -0,0 +1,125 @@
+# the plugin code was generated by this script
+# you should not change the plugin code directly, but this script
+# note: this script only creates objects in your workspace,
+# *EXCEPT* for the last call, see below.
+
+require(rkwarddev)
+
+local({
+# set the output directory to overwrite the actual plugin
+output.dir <- tempdir()
+overwrite <- TRUE
+
+about.info <- rk.XML.about(
+ name="rk.embeddingtest",
+ author=c(
+ person(given="Meik", family="Michalke",
+ email="meik.michalke at hhu.de", role=c("aut","cre"))),
+ about=list(desc="RKWard GUI to test embedding",
+ version="0.01-1", url="http://rkward.sf.net"),
+ dependencies=list(rkward.min="0.5.6")
+ )
+
+############
+## re-usable objects
+############
+
+# for data
+var.select <- rk.XML.varselector(label="Select data", id.name="var_select")
+var.data <- rk.XML.varslot(label="Data (data.frame)", source=var.select, classes=c("data.frame"), required=TRUE, id.name="var_data")
+
+tab.sset.data <- rk.XML.row(
+ var.select,
+ rk.XML.col(
+ var.data,
+ rk.XML.stretch()
+ )
+ )
+
+sset.full.dialog <- rk.XML.dialog(
+ tab.sset.data,
+ label="Embedded plugin")
+
+## logic section
+lgc.filter.script <- rk.comment(id("
+ // this will run only once, when the plugin is initialized:
+ gui.setValue (\"data\", gui.getValue(\"current_object\"));", js=FALSE))
+
+ lgc.sect.sset <- rk.XML.logic(
+ rk.XML.external("data", default=""),
+ rk.XML.connect(client="var_data", set="available", governor="data", get=""),
+ lgc.filter.script
+ )
+
+## JavaScript
+sset.js.calc <- rk.paste.JS(
+ echo("\tsset.result <- "),
+ ite(var.data, echo(var.data)),
+ echo("\n\n")
+)
+
+
+#############
+## pseudo dialog
+#############
+
+var.ps.select <- rk.XML.varselector(label="Select data", id.name="var_ps_select")
+var.ps.data <- rk.XML.varslot(label="Data (data.frame)", source=var.ps.select, classes=c("data.frame"), required=TRUE, id.name="var_ps_data")
+
+ps.embed <- rk.XML.embed("rkward::cmp_TestembeddingTestembeddng", button=TRUE, label="change data")
+
+tab.ps.data <- rk.XML.row(
+ var.ps.select,
+ rk.XML.col(
+ var.ps.data,
+ rk.XML.stretch(),
+ ps.embed
+ )
+ )
+
+ps.full.dialog <- rk.XML.dialog(
+ tab.ps.data,
+ label="Embedding plugin")
+
+## JavaScript
+ps.js.calc <- rk.paste.JS(
+ echo("\tps.result <- "),
+ ite(var.ps.data, echo(var.ps.data)),
+ echo("\n\n")
+)
+
+
+# make a whole component
+pseudo.component <- rk.plugin.component("Embedding plugin",
+ xml=list(
+# logic=ip.lgc.sect,
+ dialog=ps.full.dialog),
+ js=list(
+ calculate=ps.js.calc),
+ hierarchy=list("data"),
+ create=c("xml", "js"))
+
+
+#############
+## if you run the following function call, files will be written to tempdir!
+#############
+# this is where it get's serious, that is, here all of the above is put together into one plugin
+
+sset.plugin.dir <<- rk.plugin.skeleton(
+ about.info,
+ path=output.dir,
+ xml=list(
+ dialog=sset.full.dialog,
+ logic=lgc.sect.sset
+ ),
+ js=list(results.header=FALSE,
+ calculate=sset.js.calc),
+ pluginmap=list(name="Test embedding", hierarchy=list("data")),
+ components=list(pseudo.component),
+ create=c("pmap", "xml", "js", "desc"),
+ overwrite=overwrite,
+ tests=FALSE,
+# edit=TRUE,
+ load=TRUE)#,
+# show=TRUE)
+})
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the rkward-tracker
mailing list