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