Package jmri.util.startup
Interface StartupActionFactory
- All Superinterfaces:
JmriServiceProviderInterface
- All Known Subinterfaces:
StartupActionFactory
- All Known Implementing Classes:
AbstractStartupActionFactory
,AbstractStartupActionFactory
,AnalogClockStartupActionFactory
,AppsStartupActionFactory
,AutomatTableStartupActionFactory
,BeanTableStartupActionFactory
,BlockBossStartupActionFactory
,ConfigureXmlStartupActionFactory
,ConsistToolStartupActionFactory
,CtcEditorStartup
,CtcRunStartup
,DispatcherStartupActionFactory
,DualDecoderStartupActionFactory
,JmriSRCPStartupActionFactory
,JsonServerStartupActionFactory
,JythonStartupActionFactory
,LcdClockStartupActionFactory
,LnMessageStartupActionFactory
,LnTcpStartupActionFactory
,NixieClockStartupActionFactory
,OperationsStartupActionFactory
,PanelStartupActionFactory
,PowerStartupActionFactory
,ResourceBundleStartupActionFactory
,RosterFrameStartupActionFactory
,RosterStartupActionFactory
,SampleConfigStartUpActionFactory
,SendPacketStartupActionFactory
,ServerStartupActionFactory
,SimpleClockStartupActionFactory
,SimpleLightCtrlStartupActionFactory
,SimpleProgStartupActionFactory
,SimpleServerStartupActionFactory
,SimpleTurnoutCtrlStartupActionFactory
,SpeedometerStartupActionFactory
,SymbolicProgStartupActionFactory
,TabbedPreferencesActionFactory
,ThrottleStartupActionFactory
,TimeTableStartup
,ToolsStartupActionFactory
,TreeControlStartupActionFactory
,UsbBrowserStartupActionFactory
,VSDecoderCreationStartupActionFactory
,WebServerStartupActionFactory
,WiThrottleStartupActionFactory
public interface StartupActionFactory extends JmriServiceProviderInterface
Provide an SPI for registering potential startup actions with the
StartupActionsManager
.
Instances of this class need to be registered with a
ServiceLoader
. The best way to register is include a file
META-INF/services/jmri.util.startup.StartupActionFactory
in the
classpath (preferably in a JAR with the action the instance supports). JMRI
code uses the ServiceProvider
annotation to
generate that file.
AbstractStartupActionFactory
provides an abstract base class for
creating factories that implements most of the boilerplate needed.
-
Method Summary
Modifier and Type Method Description Class<?>[]
getActionClasses()
Get the classes this factory supports.String[]
getOverriddenClasses(Class<?> clazz)
Get startup actions overridden by the given class.String
getTitle(Class<?> clazz)
Get the title for the given class using the default locale.String
getTitle(Class<?> clazz, Locale locale)
Get the title for the given class.
-
Method Details
-
getTitle
Get the title for the given class using the default locale.- Parameters:
clazz
- the class- Returns:
- the title
- Throws:
IllegalArgumentException
- if the class is not supported by this factory
-
getTitle
@Nonnull String getTitle(@Nonnull Class<?> clazz, @Nonnull Locale locale) throws IllegalArgumentExceptionGet the title for the given class.- Parameters:
clazz
- the classlocale
- the desired locale for the title- Returns:
- the title in the given locale
- Throws:
IllegalArgumentException
- if the class is not supported by this factory
-
getActionClasses
Get the classes this factory supports.- Returns:
- the supported classes or an empty array
-
getOverriddenClasses
Get startup actions overridden by the given class. This is designed to allow a new class to replace a deprecated class.Note: the behavior is undefined if multiple classes override a single class.
- Parameters:
clazz
- the overriding class- Returns:
- the overridden classes or an empty array
- Throws:
IllegalArgumentException
- if the class is not supported by this factory
-