/* Implements JMeterGUIComponent.modifyTestElement(TestElement) */
public void modifyTestElement(TestElement args) {
stopTableEditing();
Iterator modelData = tableModel.iterator();
[[#variabledfc60a0]] arguments = null;
if (args instanceof [[#variabledfc60a0]]) {
arguments = ( [[#variabledfc60a0]]) args;
arguments.clear();
while (modelData.hasNext()) {
[[#variabledfc6040]] arg = ( [[#variabledfc6040]]) modelData.next();
arg.setMetaData("="); // $NON-NLS-1$
arguments.addArgument(arg);
}
}
this.configureTestElement(args);
}
/**
* 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.
*
* @param el
* the TestElement to configure
*/
public void configure(TestElement el) {
super.configure(el);
if (el instanceof [[#variabledfc60a0]]) {
tableModel.clearData();
PropertyIterator iter = (( [[#variabledfc60a0]]) el).iterator();
while (iter.hasNext()) {
[[#variabledfc6040]] arg = ( [[#variabledfc6040]]) iter.next().getObjectValue();
tableModel.addRow(arg);
}
}
checkDeleteStatus();
}
/**
* Get the table used to enter arguments.
*
* @return the table used to enter arguments
*/
protected JTable getTable() {
return table;
}
/**
* Get the title label for this component.
*
* @return the title label displayed with the table
*/
protected JLabel getTableLabel() {
return tableLabel;
}
/**
* Get the button used to delete rows from the table.
*
* @return the button used to delete rows from the table
*/
protected JButton getDeleteButton() {
return delete;
}
/**
* Get the button used to add rows to the table.
*
* @return the button used to add rows to the table
*/
protected JButton getAddButton() {
return add;
}
/**
* Enable or disable the delete button depending on whether or not there is
* a row to be deleted.
*/
protected void checkDeleteStatus() {
// Disable DELETE if there are no rows in the table to delete.
if (tableModel.getRowCount() == 0) {
delete.setEnabled(false);
}
else {
delete.setEnabled(true);
}
}
|