public class TestBeanGUI extends AbstractJMeterGuiComponent implements JMeterGUIComponent, LocaleChangeListener
The actual GUI is always a bean customizer: if the bean descriptor provides one, it will be used; otherwise, a GenericTestBeanCustomizer will be created for this purpose.
Those customizers deviate from the standards only in that, instead of a bean, they will receive a Map in the setObject call. This will be a property name to value Map. The customizer is also in charge of initializing empty Maps with sensible initial values.
If the provided Customizer class implements the SharedCustomizer interface, the same instance of the customizer will be reused for all beans of the type: setObject(map) can then be called multiple times. Otherwise, one separate instance will be used for each element. For efficiency reasons, most customizers should implement SharedCustomizer.
JPanel.AccessibleJPanel
JComponent.AccessibleJComponent
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
namePanel
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
TestBeanGUI()
Deprecated.
Dummy for JUnit test purposes only
|
TestBeanGUI(Class<?> testBeanClass) |
Modifier and Type | Method and Description |
---|---|
void |
clearGui()
Provides a default implementation that resets the name field to the value of
getStaticLabel(), reset comment and sets enabled to true.
|
void |
configure(TestElement element)
A newly created gui component can be initialized with the contents of a
Test Element object by calling this method.
|
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()
Compute Anchor value to find reference in documentation for a particular component
|
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 |
getStaticLabel()
Get the component's label.
|
boolean |
isExpert() |
boolean |
isHidden() |
void |
localeChanged(LocaleChangeEvent event)
Handle Locale Change by reloading BeanInfo
|
void |
modifyTestElement(TestElement element)
GUI components are responsible for populating TestElements they create
with the data currently held in the GUI components.
|
int |
setupGuiClasses()
Setup GUI class
|
String |
toString() |
configureTestElement, createTitleLabel, getComment, getName, getNamePanel, getPrintableComponent, isEnabled, makeBorder, makeScrollPane, makeScrollPane, makeTitlePanel, setComment, setEnabled, setName, wrapTitlePanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
addAncestorListener, 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, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
add, 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, validateTree
action, 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, 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, transferFocus, transferFocusBackward, transferFocusUpCycle
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
canBeAdded, getName, isEnabled, setEnabled, setName
@Deprecated public TestBeanGUI()
public TestBeanGUI(Class<?> testBeanClass)
public String getStaticLabel()
getStaticLabel
in interface JMeterGUIComponent
getStaticLabel
in class AbstractJMeterGuiComponent
JMeterGUIComponent.getLabelResource()
public TestElement createTestElement()
The canonical implementation looks like this:
public TestElement createTestElement() { TestElementXYZ el = new TestElementXYZ(); modifyTestElement(el); return el; }
createTestElement
in interface JMeterGUIComponent
public void modifyTestElement(TestElement element)
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 JMeterGUIComponent
element
- the TestElement to modifypublic JPopupMenu createPopupMenu()
createPopupMenu
in interface JMeterGUIComponent
public void configure(TestElement element)
AbstractJMeterGuiComponent provides a partial implementation of this method, setting the name of the component and its enabled status. Subclasses should override this method, performing their own configuration as needed, but also calling this super-implementation.
configure
in interface JMeterGUIComponent
configure
in class AbstractJMeterGuiComponent
element
- the TestElement to configurepublic Collection<String> getMenuCategories()
getMenuCategories
in interface JMeterGUIComponent
MenuFactory
public int setupGuiClasses()
public String getLabelResource()
getLabelResource
in interface JMeterGUIComponent
public void clearGui()
clearGui
in interface ClearGui
clearGui
in class AbstractJMeterGuiComponent
public boolean isHidden()
public boolean isExpert()
public void localeChanged(LocaleChangeEvent event)
localeChanged
in interface LocaleChangeListener
event
- LocaleChangeEvent
public String getDocAnchor()
getDocAnchor
in interface JMeterGUIComponent
getDocAnchor
in class AbstractJMeterGuiComponent
AbstractJMeterGuiComponent.getDocAnchor()
Copyright © 1998-2019 Apache Software Foundation. All Rights Reserved.