001package jmri.jmrix.bidib.swing;
002
003import jmri.jmrix.bidib.BiDiBSystemConnectionMemo;
004
005/**
006 * Provide access to Swing components for the BiDiB subsystem.
007 *
008 * @author Bob Jacobsen Copyright (C) 2010
009 * @author Eckart Meyer Copyright (C) 2019
010 * @since 4.2.2
011 */
012public class BiDiBComponentFactory extends jmri.jmrix.swing.ComponentFactory {
013
014    public BiDiBComponentFactory(BiDiBSystemConnectionMemo memo) {
015        this.memo = memo;
016    }
017
018    BiDiBSystemConnectionMemo memo;
019
020    /**
021     * Provide a menu with all items attached to this system connection
022     * 
023     * @return BiDiBMenuXXX object
024     */
025    @Override
026    public javax.swing.JMenu getMenu() {
027        if (memo.getDisabled()) {
028            return null;
029        }
030        return new BiDiBMenu(memo);
031    }
032}
033
034
035