Changeset 17308 in josm


Ignore:
Timestamp:
2020-11-11T16:39:55+01:00 (3 weeks ago)
Author:
Don-vip
Message:

fix #19995 - upload dialog: separate instances for cell renderer and editor (patch by DevCharly, modified)

Location:
trunk/src/org/openstreetmap/josm/gui/io
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/io/ActionFlagsTableCell.java

    r12866 r17308  
    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 {
  • trunk/src/org/openstreetmap/josm/gui/io/SaveLayersTableColumnModel.java

    r15623 r17308  
    9090    protected void build() {
    9191        // column 0 - layer name, save path editor
    92         LayerNameAndFilePathTableCell lnfpRenderer = new LayerNameAndFilePathTableCell();
    93         LayerNameAndFilePathTableCell lnfpEditor = new LayerNameAndFilePathTableCell();
    9492        TableColumn col = new TableColumn(0); // keep in sync with SaveLayersModel#columnFilename
    9593        col.setHeaderValue(tr("Layer Name and File Path"));
    9694        col.setResizable(true);
    97         col.setCellRenderer(lnfpRenderer);
    98         col.setCellEditor(lnfpEditor);
     95        col.setCellRenderer(new LayerNameAndFilePathTableCell());
     96        col.setCellEditor(new LayerNameAndFilePathTableCell());
    9997        col.setPreferredWidth(324);
    10098        addColumn(col);
     
    109107
    110108        // column 2- actions to take
    111         ActionFlagsTableCell aftc = new ActionFlagsTableCell();
    112109        col = new TableColumn(2); // keep in sync with SaveLayersModel#columnActions
    113110        col.setHeaderValue(tr("Actions To Take"));
    114111        col.setResizable(true);
    115         col.setCellRenderer(aftc);
    116         col.setCellEditor(aftc);
     112        col.setCellRenderer(new ActionFlagsTableCell());
     113        col.setCellEditor(new ActionFlagsTableCell());
    117114        col.setPreferredWidth(100);
    118115
Note: See TracChangeset for help on using the changeset viewer.