Search in sources :

Example 1 with TextAreaTableCellEditor

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;
}
Also used : JScrollPane(javax.swing.JScrollPane) JPanel(javax.swing.JPanel) BorderLayout(java.awt.BorderLayout) PowerTableModel(org.apache.jmeter.gui.util.PowerTableModel) JTable(javax.swing.JTable) HeaderAsPropertyRenderer(org.apache.jmeter.gui.util.HeaderAsPropertyRenderer) TextAreaTableCellEditor(org.apache.jmeter.gui.util.TextAreaTableCellEditor) Dimension(java.awt.Dimension) TextAreaCellRenderer(org.apache.jmeter.gui.util.TextAreaCellRenderer)

Aggregations

BorderLayout (java.awt.BorderLayout)1 Dimension (java.awt.Dimension)1 JPanel (javax.swing.JPanel)1 JScrollPane (javax.swing.JScrollPane)1 JTable (javax.swing.JTable)1 HeaderAsPropertyRenderer (org.apache.jmeter.gui.util.HeaderAsPropertyRenderer)1 PowerTableModel (org.apache.jmeter.gui.util.PowerTableModel)1 TextAreaCellRenderer (org.apache.jmeter.gui.util.TextAreaCellRenderer)1 TextAreaTableCellEditor (org.apache.jmeter.gui.util.TextAreaTableCellEditor)1