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