Changeset 2139 in josm


Ignore:
Timestamp:
2009-09-15T07:52:33+02:00 (15 years ago)
Author:
Gubaer
Message:

added missing JScrollPane + doc

File:
1 edited

Legend:

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

    r2115 r2139  
    1717import javax.swing.JOptionPane;
    1818import javax.swing.JPanel;
     19import javax.swing.JScrollPane;
    1920import javax.swing.event.ListSelectionEvent;
    2021import javax.swing.event.ListSelectionListener;
     
    2829import static org.openstreetmap.josm.tools.I18n.tr;
    2930
     31/**
     32 * This dialog lets the user select changesets from a list of changesets.
     33 *
     34 */
    3035public class CloseChangesetDialog extends JDialog {
    3136
     37    /** the list */
    3238    private JList lstOpenChangesets;
     39    /** true if the user cancelled the dialog */
    3340    private boolean canceled;
     41    /** the list model */
    3442    private DefaultListModel model;
    3543
     
    4654        pnl.setLayout(new BorderLayout());
    4755        model = new DefaultListModel();
    48         pnl.add(lstOpenChangesets = new JList(model), BorderLayout.CENTER);
     56        pnl.add(new JScrollPane(lstOpenChangesets = new JList(model)), BorderLayout.CENTER);
    4957        lstOpenChangesets.setCellRenderer(new ChangesetCellRenderer());
    5058        return pnl;
     
    125133    }
    126134
     135    /**
     136     * Replies true if this dialog was canceled
     137     * @return true if this dialog was canceled
     138     */
    127139    public boolean isCanceled() {
    128140        return canceled;
    129141    }
    130142
     143    /**
     144     * Sets whether this dialog is canceled
     145     *
     146     * @param canceled true, if this dialog is canceld
     147     */
    131148    protected void setCanceled(boolean canceled) {
    132149        this.canceled = canceled;
    133150    }
    134151
     152    /**
     153     * Sets the collection of changesets to be displayed
     154     *
     155     * @param changesets the collection of changesets. Assumes an empty collection if null
     156     */
    135157    public void setChangesets(Collection<Changeset> changesets) {
    136158        if (changesets == null) {
     
    143165    }
    144166
     167    /**
     168     * Replies a collection with the changesets the user selected.
     169     * Never null, but may be empty.
     170     *
     171     * @return a collection with the changesets the user selected.
     172     */
    145173    public Collection<Changeset> getSelectedChangesets() {
    146174        Object [] sel = lstOpenChangesets.getSelectedValues();
Note: See TracChangeset for help on using the changeset viewer.