Ticket #19995: JOSM-save-layers-actions.diff

File JOSM-save-layers-actions.diff, 1.7 KB (added by DevCharly, 6 years ago)
  • src/org/openstreetmap/josm/gui/io/ActionFlagsTableCell.java

     
    3434 * <br>col.setCellRenderer(aftc);
    3535 * <br>col.setCellEditor(aftc);
    3636 * </code>
     37 *
     38 * Note: Do not use the same object both as <code>TableCellRenderer</code> and
     39 * <code>TableCellEditor</code> - this can mess up the current editor component
     40 * by subsequent calls to the renderer (#19995 and #12462).
    3741 */
    3842class ActionFlagsTableCell extends JPanel implements TableCellRenderer, TableCellEditor {
    3943    private final JCheckBox[] checkBoxes = new JCheckBox[2];
  • src/org/openstreetmap/josm/gui/io/SaveLayersTableColumnModel.java

     
    108108        addColumn(col);
    109109
    110110        // column 2- actions to take
    111         ActionFlagsTableCell aftc = new ActionFlagsTableCell();
     111        ActionFlagsTableCell aftcRenderer = new ActionFlagsTableCell();
     112        ActionFlagsTableCell aftcEditor = new ActionFlagsTableCell();
    112113        col = new TableColumn(2); // keep in sync with SaveLayersModel#columnActions
    113114        col.setHeaderValue(tr("Actions To Take"));
    114115        col.setResizable(true);
    115         col.setCellRenderer(aftc);
    116         col.setCellEditor(aftc);
     116        col.setCellRenderer(aftcRenderer);
     117        col.setCellEditor(aftcEditor);
    117118        col.setPreferredWidth(100);
    118119
    119120        addColumn(col);