001package jmri.jmrit.symbolicprog;
002
003import javax.swing.JLabel;
004import javax.swing.JPanel;
005import javax.swing.JToggleButton;
006import jmri.jmrit.progsupport.ProgModeSelector;
007
008/**
009 * Provide GUI controls to select a new decoder.
010 * <p>
011 * This is an extension of the CombinedLocoSelPane class to use a JTree instead
012 * of a JComboBox for the decoder selection. The loco selection (Roster
013 * manipulation) parts are unchanged.
014 * <p>
015 * The JComboBox implementation always had to have selected entries, so we added
016 * dummy "select from .." items at the top and used those to indicate
017 * that there was no selection in that box. Here, the lack of a selection
018 * indicates there's no selection.
019 *
020 * @author Bob Jacobsen Copyright (C) 2001, 2002, 2008, 2015
021 */
022public class LocoSelTreePane extends CombinedLocoSelTreePane {
023
024    public LocoSelTreePane(JLabel s, ProgModeSelector selector) {
025        super(s, selector);
026    }
027
028    // don't show the select-roster-entry box
029    @Override
030    protected JPanel layoutRosterSelection() {
031        return null;
032    }
033
034    @Override
035    protected JPanel layoutDecoderSelection() {
036        JPanel pan = super.layoutDecoderSelection();
037        viewButtons.setVisible(false);
038        return pan;
039    }
040
041    // don't show the Ident button
042    @Override
043    JToggleButton addDecoderIdentButton() {
044        return null;
045    }
046
047}