001package jmri.jmrix.dcc4pc.swing;
002
003import jmri.jmrix.dcc4pc.Dcc4PcSystemConnectionMemo;
004
005/**
006 * JPanel extension to handle automatic creation of window title and help
007 * reference for Dcc4Pc panels
008 * <p>
009 * For use with JmriAbstractAction, etc
010 *
011 * @author Bob Jacobsen Copyright 2010
012 * @since 2.11.3
013 */
014abstract public class Dcc4PcPanel extends jmri.util.swing.JmriPanel {
015
016    /**
017     * make "memo" object available as convenience
018     */
019    protected Dcc4PcSystemConnectionMemo memo;
020
021    public void initComponents(Dcc4PcSystemConnectionMemo memo) {
022        this.memo = memo;
023    }
024
025    @Override
026    public void initContext(Object context) {
027        if (context instanceof Dcc4PcSystemConnectionMemo) {
028            initComponents((Dcc4PcSystemConnectionMemo) context);
029        }
030    }
031
032}