Package jmri.util.startup
Class AbstractActionModel
java.lang.Object
jmri.util.startup.AbstractActionModel
- All Implemented Interfaces:
StartupModel
- Direct Known Subclasses:
CreateButtonModel,PerformActionModel
Provide services for invoking actions during configuration and startup.
The action classes and corresponding human-readable names are provided by
StartupActionFactory instances.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddException(Exception exception) Add an exception to the list of exceptions thrown when loading the model or performing the action.Get the exceptions thrown by the startup model.getName()Return the name of of the model or its controlled object.booleanGet whenether this action is enabled or not.booleanbooleanisValid()Test is model is a valid model.voidPerform the startup action.protected abstract voidperformAction(Action action) voidvoidsetEnabled(boolean value) Set whenether this action is enabled or not.voidSet the name of the model.voidsetSystemPrefix(String prefix) toString()
-
Constructor Details
-
AbstractActionModel
public AbstractActionModel()
-
-
Method Details
-
getClassName
-
getName
Description copied from interface:StartupModelReturn the name of of the model or its controlled object.- Specified by:
getNamein interfaceStartupModel- Returns:
- the name, an empty string, or null
-
setName
Description copied from interface:StartupModelSet the name of the model.- Specified by:
setNamein interfaceStartupModel- Parameters:
n- the name, an empty string, or null
-
setClassName
-
getSystemPrefix
-
setSystemPrefix
-
isSystemConnectionAction
-
isValid
Description copied from interface:StartupModelTest is model is a valid model. Invalid models will not be shown or saved by the Startup Actions Preferences panel.- Specified by:
isValidin interfaceStartupModel- Returns:
- true if valid; false otherwise
-
setEnabled
Set whenether this action is enabled or not.- Specified by:
setEnabledin interfaceStartupModel- Parameters:
value- true if enabled, false otherwise
-
isEnabled
Get whenether this action is enabled or not.- Specified by:
isEnabledin interfaceStartupModel- Returns:
- true if enabled, false otherwise
-
toString
-
performAction
Description copied from interface:StartupModelPerform the startup action. The caller is responsible to ensure that this startup model is enabled before calling this method.- Specified by:
performActionin interfaceStartupModel- Throws:
JmriException- if there is an exception thrown initializing the startup item; the original exception should be available asThrowable.getCause()
-
getExceptions
Description copied from interface:StartupModelGet the exceptions thrown by the startup model.- Specified by:
getExceptionsin interfaceStartupModel- Returns:
- the list of exceptions thrown during startup in order or an empty list if no exceptions were thrown
-
addException
Description copied from interface:StartupModelAdd an exception to the list of exceptions thrown when loading the model or performing the action.- Specified by:
addExceptionin interfaceStartupModel- Parameters:
exception- the exception to retain with the model
-
performAction
- Throws:
JmriException
-