View | Details | Raw Unified | Return to bug 52679
Collapse All | Expand All

(-)src/components/org/apache/jmeter/modifiers/gui/UserParametersGui.java (-11 / +20 lines)
Lines 67-72 Link Here
67
    private JButton addParameterButton, addUserButton, deleteRowButton, deleteColumnButton;
67
    private JButton addParameterButton, addUserButton, deleteRowButton, deleteColumnButton;
68
68
69
    private JCheckBox perIterationCheck;
69
    private JCheckBox perIterationCheck;
70
    
71
    private JPanel paramPanel;
70
72
71
    public UserParametersGui() {
73
    public UserParametersGui() {
72
        super();
74
        super();
Lines 192-203 Link Here
192
        // paramTable.setRowSelectionAllowed(true);
194
        // paramTable.setRowSelectionAllowed(true);
193
        // paramTable.setColumnSelectionAllowed(true);
195
        // paramTable.setColumnSelectionAllowed(true);
194
        paramTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
196
        paramTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
195
        paramTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
196
        // paramTable.setCellSelectionEnabled(true);
197
        // paramTable.setCellSelectionEnabled(true);
197
        // paramTable.setPreferredScrollableViewportSize(new Dimension(100,
198
        // paramTable.setPreferredScrollableViewportSize(new Dimension(100,
198
        // 70));
199
        // 70));
199
200
200
        JPanel paramPanel = new JPanel(new BorderLayout());
201
        paramPanel = new JPanel(new BorderLayout());
201
        paramPanel.add(tableLabel, BorderLayout.NORTH);
202
        paramPanel.add(tableLabel, BorderLayout.NORTH);
202
        JScrollPane scroll = new JScrollPane(paramTable);
203
        JScrollPane scroll = new JScrollPane(paramTable);
203
        scroll.setPreferredSize(scroll.getMinimumSize());
204
        scroll.setPreferredSize(scroll.getMinimumSize());
Lines 229-234 Link Here
229
        return buttonPanel;
230
        return buttonPanel;
230
    }
231
    }
231
232
233
    /**
234
     * Set Column size
235
     */
236
    private void setColumnWidths() {
237
        int colSize = 200;
238
        int paneWidth = paramPanel.getWidth();
239
        if (paneWidth != 0) {
240
            paramTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
241
            if (paneWidth >= (tableModel.getColumnCount() * colSize)) {
242
                colSize = paneWidth / tableModel.getColumnCount();
243
            }
244
            for (int i = 0; i < tableModel.getColumnCount(); i++) {
245
                paramTable.getColumnModel().getColumn(i).setPreferredWidth(colSize);
246
            }
247
        }
248
    }
249
    
232
    private class AddParamAction implements ActionListener {
250
    private class AddParamAction implements ActionListener {
233
        public void actionPerformed(ActionEvent e) {
251
        public void actionPerformed(ActionEvent e) {
234
            if (paramTable.isEditing()) {
252
            if (paramTable.isEditing()) {
Lines 271-285 Link Here
271
        }
289
        }
272
    }
290
    }
273
291
274
    /**
275
     * Set Column size
276
     */
277
    private void setColumnWidths() {
278
        for (int i = 0; i < tableModel.getColumnCount(); i++) {
279
            paramTable.getColumnModel().getColumn(i).setPreferredWidth(200);
280
        }
281
    }
282
    
283
    private class DeleteRowAction implements ActionListener {
292
    private class DeleteRowAction implements ActionListener {
284
        public void actionPerformed(ActionEvent e) {
293
        public void actionPerformed(ActionEvent e) {
285
            if (paramTable.isEditing()) {
294
            if (paramTable.isEditing()) {

Return to bug 52679