001package jmri.jmrix.marklin.swing;
002
003import jmri.jmrix.marklin.MarklinSystemConnectionMemo;
004
005/**
006 * Provide access to Swing components for the Marklin subsystem.
007 *
008 * @author Kevin Dickerson 2010
009 */
010public class MarklinComponentFactory extends jmri.jmrix.swing.ComponentFactory {
011
012    public MarklinComponentFactory(MarklinSystemConnectionMemo memo) {
013        this.memo = memo;
014    }
015    MarklinSystemConnectionMemo memo;
016
017    /**
018     * Provide a menu with all items attached to this system connection
019     */
020    //JMenu currentMenu;
021    @Override
022    public javax.swing.JMenu getMenu() {
023        if (memo.getDisabled()) {
024            return null;
025        }
026        return new MarklinMenu(memo);
027    }
028}