org.apache.jmeter.threads.gui

Class ThreadGroupGui

Implemented Interfaces:
ItemListener, JMeterGUIComponent, Printable

public class ThreadGroupGui
extends AbstractJMeterGuiComponent
implements ItemListener

Field Summary

Fields inherited from class org.apache.jmeter.gui.AbstractJMeterGuiComponent

namePanel

Constructor Summary

ThreadGroupGui()
When constructing a new component, this takes care of basic tasks like setting up the Name Panel and assigning the class's static label as the name to start.

Method Summary

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 tg)
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
getLabelResource()
Get the component's resource name, which getStaticLabel uses to derive the component's label in the local language.
Collection
getMenuCategories()
This is the list of add menu categories this gui component will be available under.
Dimension
getPreferredSize()
void
itemStateChanged(ItemEvent ie)
void
modifyTestElement(TestElement tg)
Modifies a given TestElement to mirror the data in the gui components.
void
setNode(JMeterTreeNode node)

Methods inherited from class org.apache.jmeter.gui.AbstractJMeterGuiComponent

clearGui, configure, configureTestElement, createTitleLabel, getComment, getDocAnchor, getName, getNamePanel, getNode, getPrintableComponent, getStaticLabel, isEnabled, makeBorder, makeScrollPane, makeScrollPane, makeTitlePanel, setComment, setEnabled, setName, setNode

Constructor Details

ThreadGroupGui

public ThreadGroupGui()
When constructing a new component, this takes care of basic tasks like setting up the Name Panel and assigning the class's static label as the name to start.

Method Details

clearGui

public void clearGui()
Provides a default implementation that resets the name field to the value of getStaticLabel(), reset comment and sets enabled to true. Your GUI may need more things cleared, in which case you should override, clear the extra fields, and still call super.clearGui().
Specified by:
clearGui in interface JMeterGUIComponent
Overrides:
clearGui in interface AbstractJMeterGuiComponent

configure

public void configure(TestElement tg)
A newly created gui component can be initialized with the contents of a Test Element object by calling this method. The component is responsible for querying the Test Element object for the relevant information to display in its GUI.

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.

Specified by:
configure in interface JMeterGUIComponent
Overrides:
configure in interface AbstractJMeterGuiComponent
Parameters:

createPopupMenu

public 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.
Specified by:
createPopupMenu in interface JMeterGUIComponent
Returns:
a JPopupMenu appropriate for the component.

createTestElement

public TestElement createTestElement()
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.
Specified by:
createTestElement in interface JMeterGUIComponent
Returns:
the Test Element object that the GUI component represents.

getLabelResource

public String getLabelResource()
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. Normally this method should be overriden in preference to overriding getStaticLabel(). However where the resource name is not available or required, getStaticLabel() may be overridden instead.
Specified by:
getLabelResource in interface JMeterGUIComponent
Returns:
the resource name

getMenuCategories

public Collection getMenuCategories()
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.
Specified by:
getMenuCategories in interface JMeterGUIComponent
Returns:
a Collection of Strings, where each element is one of the constants defined in MenuFactory
See Also:
MenuFactory

getPreferredSize

public Dimension getPreferredSize()

itemStateChanged

public void itemStateChanged(ItemEvent ie)

modifyTestElement

public void modifyTestElement(TestElement tg)
Modifies a given TestElement to mirror the data in the gui components.
Specified by:
modifyTestElement in interface JMeterGUIComponent

setNode

public void setNode(JMeterTreeNode node)

Copyright © 1998-2010 Apache Software Foundation. All Rights Reserved.