Package apps.startup
Class StartupPauseModel
- java.lang.Object
-
- jmri.util.startup.AbstractStartupModel
-
- apps.startup.StartupPauseModel
-
- All Implemented Interfaces:
StartupModel
public class StartupPauseModel extends AbstractStartupModel
Startup action that causes JMRI to pause before triggering the next startup action.
-
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_DELAY
-
Constructor Summary
Constructors Constructor Description StartupPauseModel()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getDelay()
Get the delay this action will pause the startup action processing.java.lang.String
getName()
Return the name of of the model or its controlled object.boolean
isValid()
Test is model is a valid model.void
performAction()
Perform the startup action.void
setDelay(int delay)
Set the delay this action will pause the startup action processing.-
Methods inherited from class jmri.util.startup.AbstractStartupModel
addException, getExceptions, isEnabled, setEnabled, setName, toString
-
-
-
-
Field Detail
-
DEFAULT_DELAY
public static final int DEFAULT_DELAY
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
StartupPauseModel
public StartupPauseModel()
-
-
Method Detail
-
getName
public java.lang.String getName()
Description copied from interface:StartupModel
Return the name of of the model or its controlled object.- Specified by:
getName
in interfaceStartupModel
- Overrides:
getName
in classAbstractStartupModel
- Returns:
- the name, an empty string, or null
-
isValid
public boolean isValid()
Test is model is a valid model. Invalid models will not be shown or saved by the Startup Actions Preferences panel. The default behavior is to return true ifAbstractStartupModel.getName()
returns a non-null, non-empty String.- Specified by:
isValid
in interfaceStartupModel
- Overrides:
isValid
in classAbstractStartupModel
- Returns:
- true if duration greater than or equal to 0; false otherwise
-
getDelay
public int getDelay()
Get the delay this action will pause the startup action processing.- Returns:
- seconds delay
-
setDelay
public void setDelay(int delay)
Set the delay this action will pause the startup action processing.- Parameters:
delay
- delay in seconds
-
performAction
public void performAction() throws JmriException
Description copied from interface:StartupModel
Perform the startup action. The caller is responsible to ensure that this startup model is enabled before calling this method.- Throws:
JmriException
- if there is an exception thrown initializing the startup item; the original exception should be available asThrowable.getCause()
-
-