001// License: GPL. For details, see LICENSE file.
002package org.openstreetmap.josm.gui.dialogs.changeset;
003
004import javax.swing.DefaultListSelectionModel;
005
006import org.openstreetmap.josm.data.osm.DataSelectionListener;
007
008/**
009 * A table of changesets that displays the ones that are used by the primitives in the current selection.
010 */
011public class ChangesetInSelectionListModel extends ChangesetListModel implements DataSelectionListener {
012
013    /**
014     * Create a new {@link ChangesetInSelectionListModel}
015     * @param selectionModel The model
016     */
017    public ChangesetInSelectionListModel(DefaultListSelectionModel selectionModel) {
018        super(selectionModel);
019    }
020
021    /* ---------------------------------------------------------------------------- */
022    /* Interface DataSelectionListener                                              */
023    /* ---------------------------------------------------------------------------- */
024
025    @Override
026    public void selectionChanged(SelectionChangeEvent event) {
027        initFromPrimitives(event.getSelection());
028    }
029}