@Test public void testActionPerformed() { System.out.println("actionPerformed"); AddRowAction instance = new AddRowAction( new JPanel(), new JTable(), new PowerTableModel(TableModelEmul.columnIdentifiers, TableModelEmul.columnClasses), new JButton(), TableModelEmul.defaultValues); instance.actionPerformed(null); }
public void actionPerformed(ActionEvent e) { if (grid.isEditing()) { TableCellEditor cellEditor = grid.getCellEditor(grid.getEditingRow(), grid.getEditingColumn()); cellEditor.stopCellEditing(); } tableModel.addRow(defaultValues); tableModel.fireTableDataChanged(); deleteRowButton.setEnabled(true); int rowToSelect = tableModel.getRowCount() - 1; if (rowToSelect < grid.getRowCount()) { grid.setRowSelectionInterval(rowToSelect, rowToSelect); } sender.updateUI(); }
AddRowAction implements ActionListener { public void actionPerformed(ActionEvent e) { if (grid.isEditing()) { TableCellEditor cellEditor = grid.getCellEditor(grid.getEditingRow(), grid.getEditingColumn()); cellEditor.stopCellEditing(); } tableModel.addRow(defaultValues); tableModel.fireTableDataChanged(); deleteRowButton.setEnabled(true); int rowToSelect = tableModel.getRowCount() - 1; if (rowToSelect < grid.getRowCount()) { grid.setRowSelectionInterval(rowToSelect, rowToSelect); } sender.updateUI(); } }
AddRowAction implements ActionListener { public void actionPerformed(ActionEvent e) { if (grid.isEditing()) { TableCellEditor cellEditor = grid.getCellEditor(grid.getEditingRow(), grid.getEditingColumn()); cellEditor.stopCellEditing(); } tableModel.addRow(defaultValues); tableModel.fireTableDataChanged(); deleteRowButton.setEnabled(true); int rowToSelect = tableModel.getRowCount() - 1; if (rowToSelect < grid.getRowCount()) { grid.setRowSelectionInterval(rowToSelect, rowToSelect); } sender.updateUI(); } AddRowAction(JComponent aSender, JTable grid, PowerTableModel tableModel, JButton deleteRowButton, Object[] defaultValues); }
AddRowAction implements ActionListener { public void actionPerformed(ActionEvent e) { if (grid.isEditing()) { TableCellEditor cellEditor = grid.getCellEditor(grid.getEditingRow(), grid.getEditingColumn()); cellEditor.stopCellEditing(); } tableModel.addRow(defaultValues); tableModel.fireTableDataChanged(); deleteRowButton.setEnabled(true); int rowToSelect = tableModel.getRowCount() - 1; if (rowToSelect < grid.getRowCount()) { grid.setRowSelectionInterval(rowToSelect, rowToSelect); } sender.updateUI(); } AddRowAction(JComponent aSender, JTable grid, PowerTableModel tableModel, JButton deleteRowButton, Object[] defaultValues); void actionPerformed(ActionEvent e); }
AddRowAction implements ActionListener { public void actionPerformed(ActionEvent e) { if (grid.isEditing()) { TableCellEditor cellEditor = grid.getCellEditor(grid.getEditingRow(), grid.getEditingColumn()); cellEditor.stopCellEditing(); } tableModel.addRow(defaultValues); tableModel.fireTableDataChanged(); deleteRowButton.setEnabled(true); int rowToSelect = tableModel.getRowCount() - 1; if (rowToSelect < grid.getRowCount()) { grid.setRowSelectionInterval(rowToSelect, rowToSelect); } sender.updateUI(); } AddRowAction(JComponent aSender, JTable grid, PowerTableModel tableModel, JButton deleteRowButton, Object[] defaultValues); void actionPerformed(ActionEvent e);  }