use of org.apache.jmeter.gui.util.TextAreaTableCellEditor in project jmeter by apache.
the class AssertionGui method createStringPanel.
/**
* Create a panel allowing the user to supply a list of string patterns to
* test against.
*
* @return a new panel for adding string patterns
*/
private JPanel createStringPanel() {
tableModel = new PowerTableModel(new String[] { COL_RESOURCE_NAME }, new Class[] { String.class });
stringTable = new JTable(tableModel);
stringTable.getTableHeader().setDefaultRenderer(new HeaderAsPropertyRenderer());
stringTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
JMeterUtils.applyHiDPI(stringTable);
TextAreaCellRenderer renderer = new TextAreaCellRenderer();
stringTable.setRowHeight(renderer.getPreferredHeight());
stringTable.setDefaultRenderer(String.class, renderer);
stringTable.setDefaultEditor(String.class, new TextAreaTableCellEditor());
stringTable.setPreferredScrollableViewportSize(new Dimension(100, 70));
JPanel panel = new JPanel();
panel.setLayout(new BorderLayout());
//$NON-NLS-1$
panel.setBorder(BorderFactory.createTitledBorder(JMeterUtils.getResString("assertion_patterns_to_test")));
panel.add(new JScrollPane(stringTable), BorderLayout.CENTER);
panel.add(createButtonPanel(), BorderLayout.SOUTH);
return panel;
}
Aggregations