001package jmri.jmrix.can;
002
003import java.util.ResourceBundle;
004import jmri.InstanceManager;
005
006/**
007 * Does configuration for CAN communications implementations.
008 *
009 * @author Bob Jacobsen Copyright (C) 2010
010 */
011public class CanConfigurationManager extends ConfigurationManager {
012
013    /**
014     * Create a new CanConfigurationManager.
015     * @param memo System Connection
016     */
017    public CanConfigurationManager(CanSystemConnectionMemo memo) {
018        super(memo);
019        InstanceManager.store(cf = new jmri.jmrix.can.swing.CanComponentFactory(adapterMemo),
020            jmri.jmrix.swing.ComponentFactory.class);
021        addToCanConfigMgr();
022    }
023
024    private final jmri.jmrix.swing.ComponentFactory cf;
025    
026    protected final void addToCanConfigMgr() {
027        InstanceManager.store(this, CanConfigurationManager.class);
028    }
029    
030    /**
031     * {@inheritDoc}
032     */
033    @Override
034    public void configureManagers() {
035    }
036
037    /**
038     * Tells which managers this class provides.
039     * {@inheritDoc} 
040     */
041    @Override
042    public boolean provides(Class<?> type) {
043        return false; // nothing, by default
044    }
045
046    /**
047     * Returns nothing by default.
048     * {@inheritDoc}
049     */
050    @Override
051    public <T> T get(Class<?> T) {
052        return null;
053    }
054
055    /**
056     * {@inheritDoc}
057     */
058    @Override
059    public void dispose() {
060        if (cf != null) {
061            InstanceManager.deregister(cf, jmri.jmrix.swing.ComponentFactory.class);
062        }
063        InstanceManager.deregister(this, CanConfigurationManager.class);
064    }
065
066    /**
067     * No actions that can be loaded at startup.
068     * {@inheritDoc}
069     */
070    @Override
071    protected ResourceBundle getActionModelResourceBundle() {
072        return null;
073    }
074
075}