001package jmri.jmrit.beantable;
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 BeanTable startup actions.
010 *
011 * @author Randall Wood Copyright 2020
012 */
013@ServiceProvider(service = StartupActionFactory.class)
014public final class BeanTableStartupActionFactory extends AbstractStartupActionFactory {
015
016    @Override
017    public String getTitle(Class<?> clazz, Locale locale) throws IllegalArgumentException {
018        if (clazz.equals(AudioTableAction.class)) {
019            return Bundle.getMessage(locale, "StartupAudioTableAction"); // NOI18N
020        } else if (clazz.equals(BlockTableAction.class)) {
021            return Bundle.getMessage(locale, "StartupBlockTableAction"); // NOI18N
022        } else if (clazz.equals(IdTagTableAction.class)) {
023            return Bundle.getMessage(locale, "StartupIdTagTableAction"); // NOI18N
024        } else if (clazz.equals(LightTableAction.class)) {
025            return Bundle.getMessage(locale, "StartupLightTableAction"); // NOI18N
026        } else if (clazz.equals(ListedTableAction.class)) {
027            return Bundle.getMessage(locale, "StartupListedTableAction"); // NOI18N
028        } else if (clazz.equals(LogixTableAction.class)) {
029            return Bundle.getMessage(locale, "StartupLogixTableAction"); // NOI18N
030        } else if (clazz.equals(LogixNGTableAction.class)) {
031            return Bundle.getMessage(locale, "StartupLogixNGTableAction"); // NOI18N
032        } else if (clazz.equals(LogixNGModuleTableAction.class)) {
033            return Bundle.getMessage(locale, "StartupLogixNGModuleTableAction"); // NOI18N
034        } else if (clazz.equals(LogixNGTableTableAction.class)) {
035            return Bundle.getMessage(locale, "StartupLogixNGTableTableAction"); // NOI18N
036        } else if (clazz.equals(LogixNGGlobalVariableTableAction.class)) {
037            return Bundle.getMessage(locale, "StartupLogixNGGlobalVariableTableAction"); // NOI18N
038        } else if (clazz.equals(LRouteTableAction.class)) {
039            return Bundle.getMessage(locale, "StartupLRouteTableAction"); // NOI18N
040        } else if (clazz.equals(MemoryTableAction.class)) {
041            return Bundle.getMessage(locale, "StartupMemoryTableAction"); // NOI18N
042        } else if (clazz.equals(OBlockTableAction.class)) {
043            return Bundle.getMessage(locale, "StartupOBlockTableAction"); // NOI18N
044        } else if (clazz.equals(ReporterTableAction.class)) {
045            return Bundle.getMessage(locale, "StartupReporterTableAction"); // NOI18N
046        } else if (clazz.equals(RouteTableAction.class)) {
047            return Bundle.getMessage(locale, "StartupRouteTableAction"); // NOI18N
048        } else if (clazz.equals(SectionTableAction.class)) {
049            return Bundle.getMessage(locale, "StartupSectionTableAction"); // NOI18N
050        } else if (clazz.equals(SensorTableAction.class)) {
051            return Bundle.getMessage(locale, "StartupSensorTableAction"); // NOI18N
052        } else if (clazz.equals(SignalGroupTableAction.class)) {
053            return Bundle.getMessage(locale, "StartupSignalGroupTableAction"); // NOI18N
054        } else if (clazz.equals(SignalHeadTableAction.class)) {
055            return Bundle.getMessage(locale, "StartupSignalHeadTableAction"); // NOI18N
056        } else if (clazz.equals(SignalMastTableAction.class)) {
057            return Bundle.getMessage(locale, "StartupSignalMastTableAction"); // NOI18N
058        } else if (clazz.equals(TransitTableAction.class)) {
059            return Bundle.getMessage(locale, "StartupTransitTableAction"); // NOI18N
060        } else if (clazz.equals(TurnoutTableAction.class)) {
061            return Bundle.getMessage(locale, "StartupTurnoutTableAction"); // NOI18N
062        }
063        throw new IllegalArgumentException(clazz.getName() + " is not supported by " + this.getClass().getName());
064    }
065
066    @Override
067    public Class<?>[] getActionClasses() {
068        return new Class[]{AudioTableAction.class,
069            BlockTableAction.class,
070            IdTagTableAction.class,
071            LightTableAction.class,
072            ListedTableAction.class,
073            LogixTableAction.class,
074            LogixNGTableAction.class,
075            LogixNGModuleTableAction.class,
076            LogixNGTableTableAction.class,
077            LogixNGGlobalVariableTableAction.class,
078            LRouteTableAction.class,
079            MemoryTableAction.class,
080            OBlockTableAction.class,
081            ReporterTableAction.class,
082            RouteTableAction.class,
083            SectionTableAction.class,
084            SensorTableAction.class,
085            SignalGroupTableAction.class,
086            SignalHeadTableAction.class,
087            SignalMastTableAction.class,
088            TransitTableAction.class,
089            TurnoutTableAction.class};
090    }
091
092}