[rkward/work/generalized_preview] rkward/rbackend/rpackages/rkward: Roxygenize, newly added functions, only

Thomas Friedrichsmeier thomas.friedrichsmeier at ruhr-uni-bochum.de
Mon Dec 14 21:06:07 UTC 2015


Git commit f0ee9fe3085133ce6ede769145d796aa6dbea8dd by Thomas Friedrichsmeier.
Committed on 14/12/2015 at 13:22.
Pushed by tfry into branch 'work/generalized_preview'.

Roxygenize, newly added functions, only

M  +4    -1    rkward/rbackend/rpackages/rkward/NAMESPACE
A  +61   -0    rkward/rbackend/rpackages/rkward/man/rk.assign.preview.data.Rd

http://commits.kde.org/rkward/f0ee9fe3085133ce6ede769145d796aa6dbea8dd

diff --git a/rkward/rbackend/rpackages/rkward/NAMESPACE b/rkward/rbackend/rpackages/rkward/NAMESPACE
index 5e5ca8d..34d8c1f 100644
--- a/rkward/rbackend/rpackages/rkward/NAMESPACE
+++ b/rkward/rbackend/rpackages/rkward/NAMESPACE
@@ -1,4 +1,4 @@
-# Generated by roxygen2 (4.0.2): do not edit by hand
+# Generated by roxygen2: do not edit by hand
 
 export(.onAttach)
 export(.rk.app.version)
@@ -52,10 +52,12 @@ export(q)
 export(quartz)
 export(quit)
 export(require)
+export(rk.assign.preview.data)
 export(rk.call.plugin)
 export(rk.clear.plot.history)
 export(rk.demo)
 export(rk.describe.alternative)
+export(rk.discard.preview.data)
 export(rk.duplicate.device)
 export(rk.edit)
 export(rk.edit.files)
@@ -66,6 +68,7 @@ export(rk.force.append.plot)
 export(rk.get.description)
 export(rk.get.label)
 export(rk.get.output.html.file)
+export(rk.get.preview.data)
 export(rk.get.short.name)
 export(rk.get.tempfile.name)
 export(rk.get.workspace.url)
diff --git a/rkward/rbackend/rpackages/rkward/man/rk.assign.preview.data.Rd b/rkward/rbackend/rpackages/rkward/man/rk.assign.preview.data.Rd
new file mode 100644
index 0000000..47d6150
--- /dev/null
+++ b/rkward/rbackend/rpackages/rkward/man/rk.assign.preview.data.Rd
@@ -0,0 +1,61 @@
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/rk.plugin-functions.R
+\name{rk.assign.preview.data}
+\alias{.rk.discard.preview.data}
+\alias{rk.assign.preview.data}
+\alias{rk.discard.preview.data}
+\alias{rk.get.preview.data}
+\title{Manage (shortly) persistent data for previews (for use in RKWard plugins wishing to provide custom previews)}
+\usage{
+rk.assign.preview.data(id, value = list())
+
+rk.get.preview.data(id)
+
+rk.discard.preview.data(id)
+}
+\arguments{
+\item{id}{(character). Id associated with the data. Usually this will be the 'id' value of the <preview>-box.}
+
+\item{value.}{The value to assign. If this is a list, and contains a function named "on.delete", this function
+will be run by rk.discard.preview.data (with the \code{id} as argument. This is useful for running custom clearnup
+code, such as removing temporary files, etc.}
+}
+\value{
+\code{rk.assign.preview.data} amd \code{rk.get.preview.data} returns the preview data (newly) associated
+   with the given id. \code{rk.discard.preview.data} returns \code{NULL}, invisibly.
+
+\bold{Note}: Plugins that want to produce a single plot, or open a single object via \code{\link{rk.edit}()} do \bold{not}
+             have to call these functions, manually. See the chapter on providing previews in the Introduction to
+             writing plugins for RKWard.
+}
+\description{
+\code{rk.assign.preview.data} stores data associated with a specific "id". Usually this id is
+   provided by the <preview>-feature of a plugin.
+\code{rk.get.preview.data} retrieves data previously stored with \code{rk.assign.preview.data}
+\code{rk.discard.preview.data} discards data previously stored with \code{rk.assign.preview.data}.
+   This gets called by the <preview>-box of the plugin, automtically, when the plugin dialog is closed.
+   You do not generally have to call it manually. See the notes for running custom clearnup code, below.
+}
+\examples{
+## To be generated in the preview() code section of a plugin
+
+## NOT RUN
+outfile <- rk.get.tempfile.name(prefix="preview", extension=".html")
+rk.assign.preview.data("SOMEID", list(filename=outfile, on.delete=function (id) {
+  unlink(rk.get.preview.data(id)$filename)
+}))
+oldfile <- rk.set.output.html.file(f)
+try ({
+  rk.header("This is a preview of what will happen")
+  rk.show.html(rk.get.output.html.file())
+  rk.flush.output()
+})
+rk.set.output.html.file(outfile)
+## END NOT RUN
+
+}
+\author{
+Thomas Friedrichsmeier \email{rkward-devel at kde.org}
+}
+\keyword{utilities}
+



More information about the rkward-tracker mailing list