EVOLUTION-MANAGER
Edit File: highlightUi.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Highlight UI Elements within the RStudio IDE</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for highlightUi {rstudioapi}"><tr><td>highlightUi {rstudioapi}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Highlight UI Elements within the RStudio IDE</h2> <h3>Description</h3> <p>This function can be used to highlight UI elements within the RStudio IDE. UI elements can be selected using query selectors; most commonly, one should choose to highlight elements based on their IDs when available. </p> <h3>Usage</h3> <pre> highlightUi(queries) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>queries</code></td> <td> <p>A list of "query" objects. Each query should be a list with entries <code>"query"</code> and <code>"parent"</code>. See <strong>Queries</strong> for more details.</p> </td></tr> </table> <h3>Details</h3> <p>The tool at:</p> <pre>Help -> Diagnostics -> Show DOM Elements </pre> <p>can be useful for identifying the classes and IDs assigned to the different elements within RStudio. </p> <h3>Queries</h3> <p>Elements are selected using the same queries as through the web <code>querySelectorAll()</code> API. See <a href="https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelectorAll">https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelectorAll</a> for more details. </p> <p>For example, to highlight the Save icon within the Source pane, one might use:</p> <pre>rstudioapi::highlightUi("#rstudio_tb_savesourcedoc") </pre> <p>In some cases, multiple UI elements need to be highlighted – e.g. if you want to highlight both a menu button, and a menu item within the menu displayed after the button is pressed. We'll use the Environment Pane's Import Dataset button as an example. To highlight the <code style="white-space: pre;">From Text (readr)</code> command, you might use:</p> <pre>rstudioapi::highlightUi( list( list(query = "#rstudio_mb_import_dataset", parent = 0L), list(query = "#rstudio_label_from_text_readr_command", parent = 1L) ) ) </pre> <h3>Note</h3> <p>The <code>executeCommand</code> function was introduced in RStudio 1.3.658. </p> <hr /><div style="text-align: center;">[Package <em>rstudioapi</em> version 0.11 <a href="00Index.html">Index</a>]</div> </body></html>