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(RailComTableAction.class)) {
045            return Bundle.getMessage(locale, "StartupRailComTableAction"); // NOI18N
046        } else if (clazz.equals(ReporterTableAction.class)) {
047            return Bundle.getMessage(locale, "StartupReporterTableAction"); // NOI18N
048        } else if (clazz.equals(RouteTableAction.class)) {
049            return Bundle.getMessage(locale, "StartupRouteTableAction"); // NOI18N
050        } else if (clazz.equals(SectionTableAction.class)) {
051            return Bundle.getMessage(locale, "StartupSectionTableAction"); // NOI18N
052        } else if (clazz.equals(SensorTableAction.class)) {
053            return Bundle.getMessage(locale, "StartupSensorTableAction"); // NOI18N
054        } else if (clazz.equals(SignalGroupTableAction.class)) {
055            return Bundle.getMessage(locale, "StartupSignalGroupTableAction"); // NOI18N
056        } else if (clazz.equals(SignalHeadTableAction.class)) {
057            return Bundle.getMessage(locale, "StartupSignalHeadTableAction"); // NOI18N
058        } else if (clazz.equals(SignalMastTableAction.class)) {
059            return Bundle.getMessage(locale, "StartupSignalMastTableAction"); // NOI18N
060        } else if (clazz.equals(TransitTableAction.class)) {
061            return Bundle.getMessage(locale, "StartupTransitTableAction"); // NOI18N
062        } else if (clazz.equals(TurnoutTableAction.class)) {
063            return Bundle.getMessage(locale, "StartupTurnoutTableAction"); // NOI18N
064        }
065        throw new IllegalArgumentException(clazz.getName() + " is not supported by " + this.getClass().getName());
066    }
067
068    @Override
069    public Class<?>[] getActionClasses() {
070        return new Class[]{AudioTableAction.class,
071            BlockTableAction.class,
072            IdTagTableAction.class,
073            LightTableAction.class,
074            ListedTableAction.class,
075            LogixTableAction.class,
076            LogixNGTableAction.class,
077            LogixNGModuleTableAction.class,
078            LogixNGTableTableAction.class,
079            LogixNGGlobalVariableTableAction.class,
080            LRouteTableAction.class,
081            MemoryTableAction.class,
082            OBlockTableAction.class,
083            ReporterTableAction.class,
084            RailComTableAction.class,
085            RouteTableAction.class,
086            SectionTableAction.class,
087            SensorTableAction.class,
088            SignalGroupTableAction.class,
089            SignalHeadTableAction.class,
090            SignalMastTableAction.class,
091            TransitTableAction.class,
092            TurnoutTableAction.class};
093    }
094
095}