Package jmri.util.startup
Class AbstractFileModelFactory
- java.lang.Object
-
- jmri.util.startup.AbstractFileModelFactory
-
- All Implemented Interfaces:
JmriServiceProviderInterface
,StartupModelFactory
- Direct Known Subclasses:
PerformFileModelFactory
,PerformScriptModelFactory
public abstract class AbstractFileModelFactory extends java.lang.Object implements StartupModelFactory
Provide an abstract StartupModelFactory with common methods for factories that manipulate models that open files.
-
-
Constructor Summary
Constructors Constructor Description AbstractFileModelFactory()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
editModel(StartupModel model, java.awt.Component parent)
Allow user to edit the model.java.lang.String
getActionText()
Get the action text for models this factory generates.java.lang.String
getDescription()
Get the description for models this factory generates.void
initialize()
Provides a mechanism for theStartupActionsManager
to run any required post-construction initialization.protected abstract javax.swing.JFileChooser
setFileChooser()
This factory simply displays aJFileChooser
to allow users to configure the action.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface jmri.util.startup.StartupModelFactory
getModelClass, newModel
-
-
-
-
Constructor Detail
-
AbstractFileModelFactory
public AbstractFileModelFactory()
-
-
Method Detail
-
getDescription
public java.lang.String getDescription()
Description copied from interface:StartupModelFactory
Get the description for models this factory generates. This is used in the preferences UI to describe the class, so it should be short.- Specified by:
getDescription
in interfaceStartupModelFactory
- Returns:
- A short description.
-
setFileChooser
protected abstract javax.swing.JFileChooser setFileChooser()
This factory simply displays aJFileChooser
to allow users to configure the action. Subclasses to performAction the correct file chooser by implementing this method.- Returns:
- a configured file chooser.
-
getActionText
public java.lang.String getActionText()
Description copied from interface:StartupModelFactory
Get the action text for models this factory generates. This is used in menus and UI elements that start the process of creating and editing a new startup action. If the startup action is not configurable, this should be the same asStartupModelFactory.getDescription()
.- Specified by:
getActionText
in interfaceStartupModelFactory
- Returns:
- Action text
-
editModel
public void editModel(StartupModel model, java.awt.Component parent)
Description copied from interface:StartupModelFactory
Allow user to edit the model.- Specified by:
editModel
in interfaceStartupModelFactory
- Parameters:
model
- the model to editparent
- the parent component for the editing UI
-
initialize
public void initialize()
Description copied from interface:StartupModelFactory
Provides a mechanism for theStartupActionsManager
to run any required post-construction initialization.- Specified by:
initialize
in interfaceStartupModelFactory
-
-