| <!DOCTYPE HTML> |
| <html lang="en"> |
| <head> |
| <!-- Generated by javadoc (17) --> |
| <title>StaticJMeterGUIComponent (Apache JMeter dist API)</title> |
| <meta name="viewport" content="width=device-width, initial-scale=1"> |
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
| <meta name="description" content="declaration: package: org.apache.jmeter.gui.menu, class: StaticJMeterGUIComponent"> |
| <meta name="generator" content="javadoc/ClassWriterImpl"> |
| <link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style"> |
| <link rel="stylesheet" type="text/css" href="../../../../../script-dir/jquery-ui.min.css" title="Style"> |
| <link rel="stylesheet" type="text/css" href="../../../../../jquery-ui.overrides.css" title="Style"> |
| <script type="text/javascript" src="../../../../../script.js"></script> |
| <script type="text/javascript" src="../../../../../script-dir/jquery-3.6.1.min.js"></script> |
| <script type="text/javascript" src="../../../../../script-dir/jquery-ui.min.js"></script> |
| </head> |
| <body class="class-declaration-page"> |
| <script type="text/javascript">var evenRowColor = "even-row-color"; |
| var oddRowColor = "odd-row-color"; |
| var tableTab = "table-tab"; |
| var activeTableTab = "active-table-tab"; |
| var pathtoroot = "../../../../../"; |
| loadScripts(document, 'script');</script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| <div class="flex-box"> |
| <header role="banner" class="flex-header"> |
| <nav role="navigation"> |
| <!-- ========= START OF TOP NAVBAR ======= --> |
| <div class="top-nav" id="navbar-top"> |
| <div class="skip-nav"><a href="#skip-navbar-top" title="Skip navigation links">Skip navigation links</a></div> |
| <div class="about-language"><b>Apache JMeter</b></div> |
| <ul id="navbar-top-firstrow" class="nav-list" title="Navigation"> |
| <li><a href="../../../../../index.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="nav-bar-cell1-rev">Class</li> |
| <li><a href="package-tree.html">Tree</a></li> |
| <li><a href="../../../../../deprecated-list.html">Deprecated</a></li> |
| <li><a href="../../../../../index-all.html">Index</a></li> |
| <li><a href="../../../../../help-doc.html#class">Help</a></li> |
| </ul> |
| </div> |
| <div class="sub-nav"> |
| <div> |
| <ul class="sub-nav-list"> |
| <li>Summary: </li> |
| <li>Nested | </li> |
| <li>Field | </li> |
| <li><a href="#constructor-summary">Constr</a> | </li> |
| <li><a href="#method-summary">Method</a></li> |
| </ul> |
| <ul class="sub-nav-list"> |
| <li>Detail: </li> |
| <li>Field | </li> |
| <li><a href="#constructor-detail">Constr</a> | </li> |
| <li><a href="#method-detail">Method</a></li> |
| </ul> |
| </div> |
| <div class="nav-list-search"><label for="search-input">SEARCH:</label> |
| <input type="text" id="search-input" value="search" disabled="disabled"> |
| <input type="reset" id="reset-button" value="reset" disabled="disabled"> |
| </div> |
| </div> |
| <!-- ========= END OF TOP NAVBAR ========= --> |
| <span class="skip-nav" id="skip-navbar-top"></span></nav> |
| </header> |
| <div class="flex-content"> |
| <main role="main"> |
| <!-- ======== START OF CLASS DATA ======== --> |
| <div class="header"> |
| <div class="sub-title"><span class="package-label-in-type">Package</span> <a href="package-summary.html">org.apache.jmeter.gui.menu</a></div> |
| <h1 title="Class StaticJMeterGUIComponent" class="title">Class StaticJMeterGUIComponent</h1> |
| </div> |
| <div class="inheritance" title="Inheritance Tree"><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">java.lang.Object</a> |
| <div class="inheritance">org.apache.jmeter.gui.menu.StaticJMeterGUIComponent</div> |
| </div> |
| <section class="class-description" id="class-description"> |
| <dl class="notes"> |
| <dt>All Implemented Interfaces:</dt> |
| <dd><code><a href="../ClearGui.html" title="interface in org.apache.jmeter.gui">ClearGui</a></code>, <code><a href="../JMeterGUIComponent.html" title="interface in org.apache.jmeter.gui">JMeterGUIComponent</a></code></dd> |
| </dl> |
| <hr> |
| <div class="type-signature"><span class="annotations">@API(since="5.3", |
| status=INTERNAL) |
| </span><span class="modifiers">public class </span><span class="element-name type-name-label">StaticJMeterGUIComponent</span> |
| <span class="extends-implements">extends <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a> |
| implements <a href="../JMeterGUIComponent.html" title="interface in org.apache.jmeter.gui">JMeterGUIComponent</a></span></div> |
| <div class="block">Internal class to speedup the startup time. |
| <p>JMeter needs component names to create menus, however, default GUIComponent implementations |
| create UI elements in their constructors. This class implements just the minimal subset of the |
| methods to make menu factory happy.</p></div> |
| </section> |
| <section class="summary"> |
| <ul class="summary-list"> |
| <!-- ======== CONSTRUCTOR SUMMARY ======== --> |
| <li> |
| <section class="constructor-summary" id="constructor-summary"> |
| <h2>Constructor Summary</h2> |
| <div class="caption"><span>Constructors</span></div> |
| <div class="summary-table two-column-summary"> |
| <div class="table-header col-first">Constructor</div> |
| <div class="table-header col-last">Description</div> |
| <div class="col-constructor-name even-row-color"><code><a href="#%3Cinit%3E(java.lang.Class,org.apache.jmeter.gui.TestElementMetadata)" class="member-name-link">StaticJMeterGUIComponent</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a><?> c, |
| <a href="../TestElementMetadata.html" title="annotation in org.apache.jmeter.gui">TestElementMetadata</a> metadata)</code></div> |
| <div class="col-last even-row-color"> </div> |
| </div> |
| </section> |
| </li> |
| <!-- ========== METHOD SUMMARY =========== --> |
| <li> |
| <section class="method-summary" id="method-summary"> |
| <h2>Method Summary</h2> |
| <div id="method-summary-table"> |
| <div class="table-tabs" role="tablist" aria-orientation="horizontal"><button id="method-summary-table-tab0" role="tab" aria-selected="true" aria-controls="method-summary-table.tabpanel" tabindex="0" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table', 3)" class="active-table-tab">All Methods</button><button id="method-summary-table-tab2" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab2', 3)" class="table-tab">Instance Methods</button><button id="method-summary-table-tab4" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab4', 3)" class="table-tab">Concrete Methods</button></div> |
| <div id="method-summary-table.tabpanel" role="tabpanel"> |
| <div class="summary-table three-column-summary" aria-labelledby="method-summary-table-tab0"> |
| <div class="table-header col-first">Modifier and Type</div> |
| <div class="table-header col-second">Method</div> |
| <div class="table-header col-last">Description</div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#clearGui()" class="member-name-link">clearGui</a>()</code></div> |
| <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Clear the gui and return it to initial default values.</div> |
| </div> |
| <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div> |
| <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#configure(org.apache.jmeter.testelement.TestElement)" class="member-name-link">configure</a><wbr>(org.apache.jmeter.testelement.TestElement element)</code></div> |
| <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">The GUI must be able to extract the data from the TestElement and update |
| all GUI fields to represent those data.</div> |
| </div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.desktop/javax/swing/JPopupMenu.html" title="class or interface in javax.swing" class="external-link">JPopupMenu</a></code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#createPopupMenu()" class="member-name-link">createPopupMenu</a>()</code></div> |
| <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">When a user right-clicks on the component in the test tree, or selects |
| the edit menu when the component is selected, the component will be asked |
| to return a JPopupMenu that provides all the options available to the |
| user from this component.</div> |
| </div> |
| <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>org.apache.jmeter.testelement.TestElement</code></div> |
| <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#createTestElement()" class="member-name-link">createTestElement</a>()</code></div> |
| <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">JMeter test components are separated into a model and a GUI |
| representation.</div> |
| </div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getDocAnchor()" class="member-name-link">getDocAnchor</a>()</code></div> |
| <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Get the component's document anchor name.</div> |
| </div> |
| <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></code></div> |
| <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getLabelResource()" class="member-name-link">getLabelResource</a>()</code></div> |
| <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Get the component's resource name, which getStaticLabel uses to derive |
| the component's label in the local language.</div> |
| </div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Collection.html" title="class or interface in java.util" class="external-link">Collection</a><<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>></code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getMenuCategories()" class="member-name-link">getMenuCategories</a>()</code></div> |
| <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">This is the list of add menu categories this gui component will be |
| available under.</div> |
| </div> |
| <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></code></div> |
| <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getName()" class="member-name-link">getName</a>()</code></div> |
| <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Gets the name of the JMeter GUI component.</div> |
| </div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getStaticLabel()" class="member-name-link">getStaticLabel</a>()</code></div> |
| <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Get the component's label.</div> |
| </div> |
| <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>boolean</code></div> |
| <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#isEnabled()" class="member-name-link">isEnabled</a>()</code></div> |
| <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Test GUI elements can be disabled, in which case they do not become part |
| of the test when run.</div> |
| </div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#modifyTestElement(org.apache.jmeter.testelement.TestElement)" class="member-name-link">modifyTestElement</a><wbr>(org.apache.jmeter.testelement.TestElement element)</code></div> |
| <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">GUI components are responsible for populating TestElements they create |
| with the data currently held in the GUI components.</div> |
| </div> |
| <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div> |
| <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#setEnabled(boolean)" class="member-name-link">setEnabled</a><wbr>(boolean enabled)</code></div> |
| <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Set whether this component is enabled.</div> |
| </div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#setName(java.lang.String)" class="member-name-link">setName</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a> name)</code></div> |
| <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Sets the name of the JMeter GUI Component.</div> |
| </div> |
| </div> |
| </div> |
| </div> |
| <div class="inherited-list"> |
| <h3 id="methods-inherited-from-class-java.lang.Object">Methods inherited from class java.lang.<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></h3> |
| <code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html#clone()" title="class or interface in java.lang" class="external-link">clone</a>, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html#equals(java.lang.Object)" title="class or interface in java.lang" class="external-link">equals</a>, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html#finalize()" title="class or interface in java.lang" class="external-link">finalize</a>, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html#getClass()" title="class or interface in java.lang" class="external-link">getClass</a>, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html#hashCode()" title="class or interface in java.lang" class="external-link">hashCode</a>, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html#notify()" title="class or interface in java.lang" class="external-link">notify</a>, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html#notifyAll()" title="class or interface in java.lang" class="external-link">notifyAll</a>, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html#toString()" title="class or interface in java.lang" class="external-link">toString</a>, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html#wait()" title="class or interface in java.lang" class="external-link">wait</a>, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html#wait(long)" title="class or interface in java.lang" class="external-link">wait</a>, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html#wait(long,int)" title="class or interface in java.lang" class="external-link">wait</a></code></div> |
| <div class="inherited-list"> |
| <h3 id="methods-inherited-from-class-org.apache.jmeter.gui.JMeterGUIComponent">Methods inherited from interface org.apache.jmeter.gui.<a href="../JMeterGUIComponent.html" title="interface in org.apache.jmeter.gui">JMeterGUIComponent</a></h3> |
| <code><a href="../JMeterGUIComponent.html#assignDefaultValues(org.apache.jmeter.testelement.TestElement)">assignDefaultValues</a>, <a href="../JMeterGUIComponent.html#canBeAdded()">canBeAdded</a>, <a href="../JMeterGUIComponent.html#makeTestElement()">makeTestElement</a></code></div> |
| </section> |
| </li> |
| </ul> |
| </section> |
| <section class="details"> |
| <ul class="details-list"> |
| <!-- ========= CONSTRUCTOR DETAIL ======== --> |
| <li> |
| <section class="constructor-details" id="constructor-detail"> |
| <h2>Constructor Details</h2> |
| <ul class="member-list"> |
| <li> |
| <section class="detail" id="<init>(java.lang.Class,org.apache.jmeter.gui.TestElementMetadata)"> |
| <h3>StaticJMeterGUIComponent</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="element-name">StaticJMeterGUIComponent</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a><?> c, |
| <a href="../TestElementMetadata.html" title="annotation in org.apache.jmeter.gui">TestElementMetadata</a> metadata)</span></div> |
| </section> |
| </li> |
| </ul> |
| </section> |
| </li> |
| <!-- ============ METHOD DETAIL ========== --> |
| <li> |
| <section class="method-details" id="method-detail"> |
| <h2>Method Details</h2> |
| <ul class="member-list"> |
| <li> |
| <section class="detail" id="getLabelResource()"> |
| <h3>getLabelResource</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type"><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></span> <span class="element-name">getLabelResource</span>()</div> |
| <div class="block"><span class="descfrm-type-label">Description copied from interface: <code><a href="../JMeterGUIComponent.html#getLabelResource()">JMeterGUIComponent</a></code></span></div> |
| <div class="block">Get the component's resource name, which getStaticLabel uses to derive |
| the component's label in the local language. The resource name is fixed, |
| and does not vary with the selected language. |
| |
| <p>Normally this method should be overridden in preference to overriding |
| getStaticLabel(). However where the resource name is not available or required, |
| getStaticLabel() may be overridden instead.</p></div> |
| <dl class="notes"> |
| <dt>Specified by:</dt> |
| <dd><code><a href="../JMeterGUIComponent.html#getLabelResource()">getLabelResource</a></code> in interface <code><a href="../JMeterGUIComponent.html" title="interface in org.apache.jmeter.gui">JMeterGUIComponent</a></code></dd> |
| <dt>Returns:</dt> |
| <dd>the resource name</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="getStaticLabel()"> |
| <h3>getStaticLabel</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type"><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></span> <span class="element-name">getStaticLabel</span>()</div> |
| <div class="block"><span class="descfrm-type-label">Description copied from interface: <code><a href="../JMeterGUIComponent.html#getStaticLabel()">JMeterGUIComponent</a></code></span></div> |
| <div class="block">Get the component's label. This label is used in drop down lists that |
| give the user the option of choosing one type of component in a list of |
| many. It should therefore be a descriptive name for the end user to see. |
| It must be unique to the class. |
| |
| It is also used by Help to find the appropriate location in the |
| documentation. |
| |
| Normally getLabelResource() should be overridden instead of |
| this method; the definition of this method in AbstractJMeterGuiComponent |
| is intended for general use.</div> |
| <dl class="notes"> |
| <dt>Specified by:</dt> |
| <dd><code><a href="../JMeterGUIComponent.html#getStaticLabel()">getStaticLabel</a></code> in interface <code><a href="../JMeterGUIComponent.html" title="interface in org.apache.jmeter.gui">JMeterGUIComponent</a></code></dd> |
| <dt>Returns:</dt> |
| <dd>GUI label for the component.</dd> |
| <dt>See Also:</dt> |
| <dd> |
| <ul class="see-list-long"> |
| <li><a href="../JMeterGUIComponent.html#getLabelResource()"><code>JMeterGUIComponent.getLabelResource()</code></a></li> |
| </ul> |
| </dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="getMenuCategories()"> |
| <h3>getMenuCategories</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type"><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Collection.html" title="class or interface in java.util" class="external-link">Collection</a><<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>></span> <span class="element-name">getMenuCategories</span>()</div> |
| <div class="block"><span class="descfrm-type-label">Description copied from interface: <code><a href="../JMeterGUIComponent.html#getMenuCategories()">JMeterGUIComponent</a></code></span></div> |
| <div class="block">This is the list of add menu categories this gui component will be |
| available under. For instance, if this represents a Controller, then the |
| MenuFactory.CONTROLLERS category should be in the returned collection. |
| When a user right-clicks on a tree element and looks through the "add" |
| menu, which category your GUI component shows up in is determined by |
| which categories are returned by this method. Most GUI's belong to only |
| one category, but it is possible for a component to exist in multiple |
| categories.</div> |
| <dl class="notes"> |
| <dt>Specified by:</dt> |
| <dd><code><a href="../JMeterGUIComponent.html#getMenuCategories()">getMenuCategories</a></code> in interface <code><a href="../JMeterGUIComponent.html" title="interface in org.apache.jmeter.gui">JMeterGUIComponent</a></code></dd> |
| <dt>Returns:</dt> |
| <dd>a Collection of Strings, where each element is one of the |
| constants defined in MenuFactory</dd> |
| <dt>See Also:</dt> |
| <dd> |
| <ul class="see-list"> |
| <li><a href="../util/MenuFactory.html" title="class in org.apache.jmeter.gui.util"><code>MenuFactory</code></a></li> |
| </ul> |
| </dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="setName(java.lang.String)"> |
| <h3>setName</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type">void</span> <span class="element-name">setName</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a> name)</span></div> |
| <div class="block"><span class="descfrm-type-label">Description copied from interface: <code><a href="../JMeterGUIComponent.html#setName(java.lang.String)">JMeterGUIComponent</a></code></span></div> |
| <div class="block">Sets the name of the JMeter GUI Component. The name of the component is |
| used in the Test Tree as the name of the tree node.</div> |
| <dl class="notes"> |
| <dt>Specified by:</dt> |
| <dd><code><a href="../JMeterGUIComponent.html#setName(java.lang.String)">setName</a></code> in interface <code><a href="../JMeterGUIComponent.html" title="interface in org.apache.jmeter.gui">JMeterGUIComponent</a></code></dd> |
| <dt>Parameters:</dt> |
| <dd><code>name</code> - the name of the component</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="getName()"> |
| <h3>getName</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type"><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></span> <span class="element-name">getName</span>()</div> |
| <div class="block"><span class="descfrm-type-label">Description copied from interface: <code><a href="../JMeterGUIComponent.html#getName()">JMeterGUIComponent</a></code></span></div> |
| <div class="block">Gets the name of the JMeter GUI component. The name of the component is |
| used in the Test Tree as the name of the tree node.</div> |
| <dl class="notes"> |
| <dt>Specified by:</dt> |
| <dd><code><a href="../JMeterGUIComponent.html#getName()">getName</a></code> in interface <code><a href="../JMeterGUIComponent.html" title="interface in org.apache.jmeter.gui">JMeterGUIComponent</a></code></dd> |
| <dt>Returns:</dt> |
| <dd>the name of the component</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="getDocAnchor()"> |
| <h3>getDocAnchor</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type"><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></span> <span class="element-name">getDocAnchor</span>()</div> |
| <div class="block"><span class="descfrm-type-label">Description copied from interface: <code><a href="../JMeterGUIComponent.html#getDocAnchor()">JMeterGUIComponent</a></code></span></div> |
| <div class="block">Get the component's document anchor name. Used by Help to find the |
| appropriate location in the documentation</div> |
| <dl class="notes"> |
| <dt>Specified by:</dt> |
| <dd><code><a href="../JMeterGUIComponent.html#getDocAnchor()">getDocAnchor</a></code> in interface <code><a href="../JMeterGUIComponent.html" title="interface in org.apache.jmeter.gui">JMeterGUIComponent</a></code></dd> |
| <dt>Returns:</dt> |
| <dd>Document anchor (#ref) for the component.</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="createTestElement()"> |
| <h3>createTestElement</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type">org.apache.jmeter.testelement.TestElement</span> <span class="element-name">createTestElement</span>()</div> |
| <div class="block"><span class="descfrm-type-label">Description copied from interface: <code><a href="../JMeterGUIComponent.html#createTestElement()">JMeterGUIComponent</a></code></span></div> |
| <div class="block">JMeter test components are separated into a model and a GUI |
| representation. The model holds the data and the GUI displays it. The GUI |
| class is responsible for knowing how to create and initialize with data |
| the model class that it knows how to display, and this method is called |
| when new test elements are created. |
| |
| <p>Since 5.6.3, the default implementation is as follows, and subclasses should override |
| <a href="../JMeterGUIComponent.html#makeTestElement()"><code>JMeterGUIComponent.makeTestElement()</code></a> |
| <pre> |
| public TestElement createTestElement() { |
| TestElement element = makeTestElement(); |
| assignDefaultValues(element); |
| return el; |
| } |
| </pre> |
| |
| <p> |
| Before 5.6.3 the canonical implementation was as follows, however, it is recommended to |
| avoid overriding <a href="../JMeterGUIComponent.html#createTestElement()"><code>JMeterGUIComponent.createTestElement()</code></a> and override <a href="../JMeterGUIComponent.html#makeTestElement()"><code>JMeterGUIComponent.makeTestElement()</code></a> instead. |
| <pre> |
| public TestElement createTestElement() { |
| TestElementXYZ el = new TestElementXYZ(); |
| modifyTestElement(el); |
| return el; |
| } |
| </pre></div> |
| <dl class="notes"> |
| <dt>Specified by:</dt> |
| <dd><code><a href="../JMeterGUIComponent.html#createTestElement()">createTestElement</a></code> in interface <code><a href="../JMeterGUIComponent.html" title="interface in org.apache.jmeter.gui">JMeterGUIComponent</a></code></dd> |
| <dt>Returns:</dt> |
| <dd>the Test Element object that the GUI component represents.</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="modifyTestElement(org.apache.jmeter.testelement.TestElement)"> |
| <h3>modifyTestElement</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type">void</span> <span class="element-name">modifyTestElement</span><wbr><span class="parameters">(org.apache.jmeter.testelement.TestElement element)</span></div> |
| <div class="block"><span class="descfrm-type-label">Description copied from interface: <code><a href="../JMeterGUIComponent.html#modifyTestElement(org.apache.jmeter.testelement.TestElement)">JMeterGUIComponent</a></code></span></div> |
| <div class="block">GUI components are responsible for populating TestElements they create |
| with the data currently held in the GUI components. This method should |
| overwrite whatever data is currently in the TestElement as it is called |
| after a user has filled out the form elements in the gui with new |
| information. |
| |
| <p> |
| If you override <a href="../AbstractJMeterGuiComponent.html" title="class in org.apache.jmeter.gui"><code>AbstractJMeterGuiComponent</code></a>, you might want using <a href="../AbstractJMeterGuiComponent.html#bindingGroup"><code>AbstractJMeterGuiComponent.bindingGroup</code></a> |
| instead of overriding <code>modifyTestElement</code>. |
| |
| <p> |
| The canonical implementation looks like this: |
| <pre> |
| @Override |
| public void modifyTestElement(TestElement element) { |
| super.modifyTestElement(element); // clear the element and assign basic fields like name, gui class, test class |
| // Using the element setters (preferred): |
| // If the field is empty, you probably want to remove the property instead of storing an empty string |
| // See <a href="https://github.com/apache/jmeter/pull/6199">Streamline binding of UI elements to TestElement properties</a> |
| // for more details |
| TestElementXYZ xyz = (TestElementXYZ) element; |
| xyz.setState(StringUtils.defaultIfEmpty(guiState.getText(), null)); |
| xyz.setCode(StringUtils.defaultIfEmpty(guiCode.getText(), null)); |
| ... other GUI fields ... |
| // or directly (do not use unless there is no setter for the field): |
| element.setProperty(TestElementXYZ.STATE, StringUtils.defaultIfEmpty(guiState.getText(), null)) |
| element.setProperty(TestElementXYZ.CODE, StringUtils.defaultIfEmpty(guiCode.getText(), null)) |
| ... other GUI fields ... |
| } |
| </pre></div> |
| <dl class="notes"> |
| <dt>Specified by:</dt> |
| <dd><code><a href="../JMeterGUIComponent.html#modifyTestElement(org.apache.jmeter.testelement.TestElement)">modifyTestElement</a></code> in interface <code><a href="../JMeterGUIComponent.html" title="interface in org.apache.jmeter.gui">JMeterGUIComponent</a></code></dd> |
| <dt>Parameters:</dt> |
| <dd><code>element</code> - the TestElement to modify</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="isEnabled()"> |
| <h3>isEnabled</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type">boolean</span> <span class="element-name">isEnabled</span>()</div> |
| <div class="block"><span class="descfrm-type-label">Description copied from interface: <code><a href="../JMeterGUIComponent.html#isEnabled()">JMeterGUIComponent</a></code></span></div> |
| <div class="block">Test GUI elements can be disabled, in which case they do not become part |
| of the test when run.</div> |
| <dl class="notes"> |
| <dt>Specified by:</dt> |
| <dd><code><a href="../JMeterGUIComponent.html#isEnabled()">isEnabled</a></code> in interface <code><a href="../JMeterGUIComponent.html" title="interface in org.apache.jmeter.gui">JMeterGUIComponent</a></code></dd> |
| <dt>Returns:</dt> |
| <dd>true if the element should be part of the test run, false |
| otherwise</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="setEnabled(boolean)"> |
| <h3>setEnabled</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type">void</span> <span class="element-name">setEnabled</span><wbr><span class="parameters">(boolean enabled)</span></div> |
| <div class="block"><span class="descfrm-type-label">Description copied from interface: <code><a href="../JMeterGUIComponent.html#setEnabled(boolean)">JMeterGUIComponent</a></code></span></div> |
| <div class="block">Set whether this component is enabled.</div> |
| <dl class="notes"> |
| <dt>Specified by:</dt> |
| <dd><code><a href="../JMeterGUIComponent.html#setEnabled(boolean)">setEnabled</a></code> in interface <code><a href="../JMeterGUIComponent.html" title="interface in org.apache.jmeter.gui">JMeterGUIComponent</a></code></dd> |
| <dt>Parameters:</dt> |
| <dd><code>enabled</code> - true for enabled, false for disabled.</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="createPopupMenu()"> |
| <h3>createPopupMenu</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type"><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.desktop/javax/swing/JPopupMenu.html" title="class or interface in javax.swing" class="external-link">JPopupMenu</a></span> <span class="element-name">createPopupMenu</span>()</div> |
| <div class="block"><span class="descfrm-type-label">Description copied from interface: <code><a href="../JMeterGUIComponent.html#createPopupMenu()">JMeterGUIComponent</a></code></span></div> |
| <div class="block">When a user right-clicks on the component in the test tree, or selects |
| the edit menu when the component is selected, the component will be asked |
| to return a JPopupMenu that provides all the options available to the |
| user from this component.</div> |
| <dl class="notes"> |
| <dt>Specified by:</dt> |
| <dd><code><a href="../JMeterGUIComponent.html#createPopupMenu()">createPopupMenu</a></code> in interface <code><a href="../JMeterGUIComponent.html" title="interface in org.apache.jmeter.gui">JMeterGUIComponent</a></code></dd> |
| <dt>Returns:</dt> |
| <dd>a JPopupMenu appropriate for the component.</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="configure(org.apache.jmeter.testelement.TestElement)"> |
| <h3>configure</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type">void</span> <span class="element-name">configure</span><wbr><span class="parameters">(org.apache.jmeter.testelement.TestElement element)</span></div> |
| <div class="block"><span class="descfrm-type-label">Description copied from interface: <code><a href="../JMeterGUIComponent.html#configure(org.apache.jmeter.testelement.TestElement)">JMeterGUIComponent</a></code></span></div> |
| <div class="block">The GUI must be able to extract the data from the TestElement and update |
| all GUI fields to represent those data. This method is called to allow |
| JMeter to show the user the GUI that represents the test element's data. |
| |
| <p> |
| The canonical implementation looks like this: |
| <pre> |
| public void configure(TestElement element) { |
| super.configure(element); |
| // Using the element getter (preferred): |
| TestElementXYZ xyz = (TestElementXYZ) element; |
| guiState.setText(xyz.getState()); |
| guiCode.setText(xyz.getCode()); |
| ... other GUI fields ... |
| // or using the element property names directly (do not use unless there is no getter for the field) |
| guiState.setText(element.getPropertyAsString(TestElementXYZ.STATE)); |
| guiCode.setText(element.getPropertyAsString(TestElementXYZ.CODE)); |
| ... other GUI fields ... |
| } |
| </pre></div> |
| <dl class="notes"> |
| <dt>Specified by:</dt> |
| <dd><code><a href="../JMeterGUIComponent.html#configure(org.apache.jmeter.testelement.TestElement)">configure</a></code> in interface <code><a href="../JMeterGUIComponent.html" title="interface in org.apache.jmeter.gui">JMeterGUIComponent</a></code></dd> |
| <dt>Parameters:</dt> |
| <dd><code>element</code> - the TestElement to configure</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="clearGui()"> |
| <h3>clearGui</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type">void</span> <span class="element-name">clearGui</span>()</div> |
| <div class="block"><span class="descfrm-type-label">Description copied from interface: <code><a href="../ClearGui.html#clearGui()">ClearGui</a></code></span></div> |
| <div class="block">Clear the gui and return it to initial default values. This is necessary |
| because most gui classes are instantiated just once and re-used for |
| multiple test element objects and thus they need to be cleared between |
| uses.</div> |
| <dl class="notes"> |
| <dt>Specified by:</dt> |
| <dd><code><a href="../ClearGui.html#clearGui()">clearGui</a></code> in interface <code><a href="../ClearGui.html" title="interface in org.apache.jmeter.gui">ClearGui</a></code></dd> |
| </dl> |
| </section> |
| </li> |
| </ul> |
| </section> |
| </li> |
| </ul> |
| </section> |
| <!-- ========= END OF CLASS DATA ========= --> |
| </main> |
| <footer role="contentinfo"> |
| <hr> |
| <p class="legal-copy"><small>Copyright © 1998-2024 Apache Software Foundation. All Rights Reserved.</small></p> |
| </footer> |
| </div> |
| </div> |
| </body> |
| </html> |