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