001package jmri.jmrix.ieee802154.xbee.swing;
002
003import jmri.jmrix.ieee802154.xbee.XBeeConnectionMemo;
004
005/**
006 * Provide access to Swing components for the XBee subsystem.
007 *
008 * @author Bob Jacobsen Copyright (C) 2014
009 */
010public class XBeeComponentFactory extends jmri.jmrix.swing.ComponentFactory {
011
012    public XBeeComponentFactory(XBeeConnectionMemo memo) {
013        this.memo = memo;
014    }
015
016    final XBeeConnectionMemo memo;
017
018    /**
019     * Provide a menu with all items attached to this system connection
020     */
021    @Override
022    public javax.swing.JMenu getMenu() {
023        if (memo.getDisabled()) {
024            return null;
025        }
026        return new XBeeMenu(memo);
027    }
028}
029
030