down.setActionCommand(DOWN); checkButtonsStatus();
/** * 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 */ @Override public void configure(TestElement el) { super.configure(el); if (el instanceof Arguments) { tableModel.clearData(); for (JMeterProperty jMeterProperty : (Arguments) el) { Argument arg = (Argument) jMeterProperty.getObjectValue(); tableModel.addRow(arg); } } checkButtonsStatus(); }
/** * Remove the currently selected argument from the table. */ protected void deleteArgument() { GuiUtils.cancelEditing(table); int[] rowsSelected = table.getSelectedRows(); int anchorSelection = table.getSelectionModel().getAnchorSelectionIndex(); table.clearSelection(); if (rowsSelected.length > 0) { for (int i = rowsSelected.length - 1; i >= 0; i--) { tableModel.removeRow(rowsSelected[i]); } // Table still contains one or more rows, so highlight (select) // the appropriate one. if (tableModel.getRowCount() > 0) { if (anchorSelection >= tableModel.getRowCount()) { anchorSelection = tableModel.getRowCount() - 1; } table.setRowSelectionInterval(anchorSelection, anchorSelection); } checkButtonsStatus(); } }
/** * Add a new argument row to the table. */ protected void addArgument() { // If a table cell is being edited, we should accept the current value // and stop the editing before adding a new row. GuiUtils.stopTableEditing(table); tableModel.addRow(makeNewArgument()); checkButtonsStatus(); // Highlight (select) and scroll to the appropriate row. int rowToSelect = tableModel.getRowCount() - 1; table.setRowSelectionInterval(rowToSelect, rowToSelect); table.scrollRectToVisible(table.getCellRect(rowToSelect, 0, true)); }