org.apache.jmeter.config.gui

Class ArgumentsPanel

Implemented Interfaces:
ActionListener, JMeterGUIComponent, Printable
Known Direct Subclasses:
HTTPArgumentsPanel

public class ArgumentsPanel
extends AbstractConfigGui
implements ActionListener

A GUI panel allowing the user to enter name-value argument pairs. These arguments (or parameters) are usually used to provide configuration values for some other component.

Field Summary

static String
COLUMN_RESOURCE_NAMES_0
static String
COLUMN_RESOURCE_NAMES_1
protected ObjectTableModel
tableModel
The model for the arguments table.

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

namePanel

Constructor Summary

ArgumentsPanel()
Create a new ArgumentsPanel as a standalone component.
ArgumentsPanel(String label)
Create a new ArgumentsPanel as an embedded component, using the specified title.
ArgumentsPanel(String label, Color bkg)
Create a new ArgumentsPanel with a border and color background

Method Summary

void
actionPerformed(ActionEvent e)
Invoked when an action occurs.
protected void
addArgument()
Add a new argument row to the table.
protected void
checkDeleteStatus()
Enable or disable the delete button depending on whether or not there is a row to be deleted.
void
clear()
Clear all rows from the table.
void
clearGui()
Clear the gui and return it to initial default values.
void
configure(TestElement el)
A newly created component can be initialized with the contents of a Test Element object by calling this method.
TestElement
createTestElement()
JMeter test components are separated into a model and a GUI representation.
protected void
deleteArgument()
Remove the currently selected argument from the table.
protected JButton
getAddButton()
Get the button used to add rows to the table.
protected JButton
getDeleteButton()
Get the button used to delete rows from the table.
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 menu categories this gui component will be available under.
protected JTable
getTable()
Get the table used to enter arguments.
protected JLabel
getTableLabel()
Get the title label for this component.
protected void
initializeTableModel()
Initialize the table model used for the arguments table.
protected Component
makeLabelPanel()
Create a panel containing the title label for the table.
protected Object
makeNewArgument()
Create a new Argument object.
void
modifyTestElement(TestElement args)
GUI components are responsible for populating TestElements they create with the data currently held in the GUI components.
protected void
sizeColumns(JTable _table)
Resize the table columns to appropriate widths.
protected void
stopTableEditing()
Stop any editing that is currently being done on the table.
static boolean
testFunctors()

Methods inherited from class org.apache.jmeter.config.gui.AbstractConfigGui

createPopupMenu, getMenuCategories

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

Field Details

COLUMN_RESOURCE_NAMES_0

public static final String COLUMN_RESOURCE_NAMES_0

COLUMN_RESOURCE_NAMES_1

public static final String COLUMN_RESOURCE_NAMES_1

tableModel

protected ObjectTableModel tableModel
The model for the arguments table.

Constructor Details

ArgumentsPanel

public ArgumentsPanel()
Create a new ArgumentsPanel as a standalone component.

ArgumentsPanel

public ArgumentsPanel(String label)
Create a new ArgumentsPanel as an embedded component, using the specified title.
Parameters:
label - the title for the component.

ArgumentsPanel

public ArgumentsPanel(String label,
                      Color bkg)
Create a new ArgumentsPanel with a border and color background
Parameters:
label - text for label
bkg - background colour

Method Details

actionPerformed

public void actionPerformed(ActionEvent e)
Invoked when an action occurs. This implementation supports the add and delete buttons.
Parameters:
e - the event that has occurred

addArgument

protected void addArgument()
Add a new argument row to the table.

checkDeleteStatus

protected void checkDeleteStatus()
Enable or disable the delete button depending on whether or not there is a row to be deleted.

clear

public void clear()
Clear all rows from the table. T.Elanjchezhiyan(chezhiyan@siptech.co.in)

clearGui

public void clearGui()
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 use.
Specified by:
clearGui in interface JMeterGUIComponent
Overrides:
clearGui in interface AbstractJMeterGuiComponent

configure

public void configure(TestElement el)
A newly created 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.
Specified by:
configure in interface JMeterGUIComponent
Overrides:
configure in interface AbstractJMeterGuiComponent
Parameters:
el - the TestElement to configure

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.

deleteArgument

protected void deleteArgument()
Remove the currently selected argument from the table.

getAddButton

protected JButton getAddButton()
Get the button used to add rows to the table.
Returns:
the button used to add rows to the table

getDeleteButton

protected JButton getDeleteButton()
Get the button used to delete rows from the table.
Returns:
the button used to delete rows from the table

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 menu categories this gui component will be available under.
Specified by:
getMenuCategories in interface JMeterGUIComponent
Overrides:
getMenuCategories in interface AbstractConfigGui
Returns:
a Collection of Strings, where each element is one of the constants defined in MenuFactory

getTable

protected JTable getTable()
Get the table used to enter arguments.
Returns:
the table used to enter arguments

getTableLabel

protected JLabel getTableLabel()
Get the title label for this component.
Returns:
the title label displayed with the table

initializeTableModel

protected void initializeTableModel()
Initialize the table model used for the arguments table.

makeLabelPanel

protected Component makeLabelPanel()
Create a panel containing the title label for the table.
Returns:
a panel containing the title label

makeNewArgument

protected Object makeNewArgument()
Create a new Argument object.
Returns:
a new Argument object

modifyTestElement

public void modifyTestElement(TestElement args)
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.
Specified by:
modifyTestElement in interface JMeterGUIComponent
Parameters:

sizeColumns

protected void sizeColumns(JTable _table)
Resize the table columns to appropriate widths.
Parameters:
_table - the table to resize columns for

stopTableEditing

protected void stopTableEditing()
Stop any editing that is currently being done on the table. This will save any changes that have already been made.

testFunctors

public static boolean testFunctors()

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