Changeset 15604 in josm for trunk


Ignore:
Timestamp:
2019-12-21T03:43:07+01:00 (5 years ago)
Author:
Don-vip
Message:

fix #18429 - Adds an ancestor listener that listens for the ancestorAdded call (patch by taylor.smock)

File:
1 edited

Legend:

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

    r15600 r15604  
    2424import javax.swing.JLabel;
    2525import javax.swing.JPanel;
     26import javax.swing.event.AncestorEvent;
     27import javax.swing.event.AncestorListener;
    2628import javax.swing.event.ChangeEvent;
    2729import javax.swing.event.ChangeListener;
     
    116118            automaticallyAddSource();
    117119        }
     120        pnl.addAncestorListener(new AncestorListener() {
     121            @Override
     122            public void ancestorAdded(AncestorEvent event) {
     123                if (obtainSourceAutomatically.isSelected())
     124                    automaticallyAddSource();
     125            }
     126
     127            @Override
     128            public void ancestorRemoved(AncestorEvent event) {
     129                // Do nothing
     130            }
     131
     132            @Override
     133            public void ancestorMoved(AncestorEvent event) {
     134                // Do nothing
     135            }
     136        });
    118137        return pnl;
    119138    }
Note: See TracChangeset for help on using the changeset viewer.