public class NamePanel extends JPanel implements JMeterGUIComponent
JPanel.AccessibleJPanelJComponent.AccessibleJComponentContainer.AccessibleAWTContainerComponent.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategylistenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWaccessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH| Constructor and Description |
|---|
NamePanel()
Create a new NamePanel with the default name.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clearGui()
Clear the gui and return it to initial default values.
|
void |
configure(TestElement testElement)
The GUI must be able to extract the data from the TestElement and update
all GUI fields to represent those data.
|
JPopupMenu |
createPopupMenu()
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.
|
TestElement |
createTestElement()
JMeter test components are separated into a model and a GUI
representation.
|
String |
getDocAnchor()
Get the component's document anchor name.
|
String |
getLabelResource()
Get the component's resource name, which getStaticLabel uses to derive
the component's label in the local language.
|
Collection<String> |
getMenuCategories()
This is the list of add menu categories this gui component will be
available under.
|
String |
getName()
Get the currently displayed name.
|
JTextField |
getNameField() |
String |
getStaticLabel()
Get the component's label.
|
void |
modifyTestElement(TestElement wb)
GUI components are responsible for populating TestElements they create
with the data currently held in the GUI components.
|
void |
setName(String name)
Sets the name of the JMeter GUI Component.
|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUIaddAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, updateadd, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTreeaction, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycleclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcanBeAdded, isEnabled, setEnabled@API(status=INTERNAL,
since="5.2.0")
public JTextField getNameField()
public void clearGui()
ClearGuipublic String getName()
getName in interface JMeterGUIComponentgetName in class Componentpublic void setName(String name)
setName in interface JMeterGUIComponentsetName in class Componentname - the name of the componentpublic void configure(TestElement testElement)
The canonical implementation looks like this:
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 ...
}
configure in interface JMeterGUIComponenttestElement - the TestElement to configurepublic JPopupMenu createPopupMenu()
createPopupMenu in interface JMeterGUIComponentpublic String getStaticLabel()
getStaticLabel in interface JMeterGUIComponentJMeterGUIComponent.getLabelResource()public String getLabelResource()
getLabelResource in interface JMeterGUIComponentpublic Collection<String> getMenuCategories()
getMenuCategories in interface JMeterGUIComponentMenuFactorypublic TestElement createTestElement()
The canonical implementation looks like this:
public TestElement createTestElement() {
TestElementXYZ el = new TestElementXYZ();
modifyTestElement(el);
return el;
}
createTestElement in interface JMeterGUIComponentpublic void modifyTestElement(TestElement wb)
The canonical implementation looks like this:
public void modifyTestElement(TestElement element) {
element.clear(); // many implementations use this
configureTestElement(element);
// Using the element setters (preferred):
TestElementXYZ xyz = (TestElementXYZ) element;
xyz.setState(guiState.getText());
xyz.setCode(guiCode.getText());
... other GUI fields ...
// or directly (do not use unless there is no setter for the field):
element.setProperty(TestElementXYZ.STATE, guiState.getText())
element.setProperty(TestElementXYZ.CODE, guiCode.getText())
... other GUI fields ...
}
modifyTestElement in interface JMeterGUIComponentwb - the TestElement to modifypublic String getDocAnchor()
getDocAnchor in interface JMeterGUIComponentCopyright © 1998-2019 Apache Software Foundation. All Rights Reserved.