001package jmri.jmrit.throttle;
002
003import java.util.Locale;
004import jmri.util.startup.AbstractStartupActionFactory;
005import jmri.util.startup.StartupActionFactory;
006import org.openide.util.lookup.ServiceProvider;
007
008/**
009 * Factory for Throttle actions.
010 * 
011 * @author Randall Wood Copyright 2020
012 */
013@ServiceProvider(service = StartupActionFactory.class)
014public final class ThrottleStartupActionFactory extends AbstractStartupActionFactory {
015
016    @Override
017    public String getTitle(Class<?> clazz, Locale locale) throws IllegalArgumentException {
018        if (clazz.equals(LoadDefaultXmlThrottlesLayoutAction.class)) {
019            return Bundle.getMessage(locale, "StartupLoadDefaultXmlThrottlesLayoutAction");
020        } else if (clazz.equals(ThrottleCreationAction.class)) {
021            return Bundle.getMessage(locale, "MenuItemNewThrottle");
022        } else if (clazz.equals(ThrottlesListAction.class)) {
023            return Bundle.getMessage(locale, "ThrottleToolBarOpenThrottleListToolTip");
024        }
025        throw new IllegalArgumentException(clazz.getName() + " is not supported by " + this.getClass().getName());
026    }
027
028    @Override
029    public Class<?>[] getActionClasses() {
030        return new Class[]{LoadDefaultXmlThrottlesLayoutAction.class, ThrottleCreationAction.class, ThrottlesListAction.class};
031    }
032    
033}