Changeset 14546 in josm for trunk/src/org


Ignore:
Timestamp:
2018-12-10T13:13:38+01:00 (6 years ago)
Author:
GerdP
Message:

see #17040 implement Destroyable in ChangesetDetailPanel and use it

Removes listeners added with each use of ChangesetManager (Ctrl+Alt+C)

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

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetCacheManager.java

    r14410 r14546  
    6565import org.openstreetmap.josm.io.NetworkManager;
    6666import org.openstreetmap.josm.io.OnlineResource;
     67import org.openstreetmap.josm.tools.Destroyable;
    6768import org.openstreetmap.josm.tools.ImageProvider;
    6869import org.openstreetmap.josm.tools.InputMapUtils;
     
    104105            instance.setVisible(true);
    105106            instance.dispose();
     107            for (Component c : instance.pnlChangesetDetailTabs.getComponents()) {
     108                if (c instanceof Destroyable) {
     109                    ((Destroyable) c).destroy();
     110                }
     111            }
    106112            instance = null;
    107113        }
  • trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetDetailPanel.java

    r14432 r14546  
    4646import org.openstreetmap.josm.io.NetworkManager;
    4747import org.openstreetmap.josm.io.OnlineResource;
     48import org.openstreetmap.josm.tools.Destroyable;
    4849import org.openstreetmap.josm.tools.ImageProvider;
    4950import org.openstreetmap.josm.tools.Utils;
     
    5556 * @since 2689
    5657 */
    57 public class ChangesetDetailPanel extends JPanel implements PropertyChangeListener, ChangesetAware {
     58public class ChangesetDetailPanel extends JPanel implements PropertyChangeListener, ChangesetAware, Destroyable {
    5859
    5960    // CHECKSTYLE.OFF: SingleSpaceSeparator
     
    477478        return currentChangeset;
    478479    }
     480
     481    @Override
     482    public void destroy() {
     483        MainApplication.getLayerManager().removeActiveLayerChangeListener(actSelectInCurrentLayer);
     484        MainApplication.getLayerManager().removeActiveLayerChangeListener(actZoomInCurrentLayerAction);
     485    }
    479486}
Note: See TracChangeset for help on using the changeset viewer.